From a pipe assembly perspective, is there any significant performance
difference between the following equivalent (are they?) implementations?
Will Case 1 use the same number of MRs as Case 2?

Say I have (deffilterop foo1 ...), (deffilterop foo2 ...), etc

Case 1 (separated sub-queries):
(defn foo1-wrapper [src]
(<- [?tup]
(src ?tup)
(foo1 ?tup)))
and so on for foo2, foo3, etc.

Then execute everything nested (?- (stdout) (foo1-wrapper (foo2-wrapper
...)))

Case 2 (one big query):

(?<- (stdout)
(src ?tup)
(foo1 ?tup)
(foo2 ?tup)
(...))

Search Discussions

  • Nathanmarz at Feb 4, 2012 at 1:58 am
    A subquery will by default distinct all the output tuples, which
    requires a reduce step. You can make Case 1 and Case 2 equivalent by
    adding a (:distinct false) clause to all your subquery wrappers. The
    pipe assemblies will still be slightly different, but not enough to
    make any performance difference.

    On Feb 2, 9:03 am, Paul Lam wrote:
    From a pipe assembly perspective, is there any significant performance
    difference between the following equivalent (are they?) implementations?
    Will Case 1 use the same number of MRs as Case 2?

    Say I have (deffilterop foo1 ...), (deffilterop foo2 ...), etc

    Case 1 (separated sub-queries):
    (defn foo1-wrapper [src]
    (<- [?tup]
    (src ?tup)
    (foo1 ?tup)))
    and so on for foo2, foo3, etc.

    Then execute everything nested (?- (stdout) (foo1-wrapper (foo2-wrapper
    ...)))

    Case 2 (one big query):

    (?<- (stdout)
    (src ?tup)
    (foo1 ?tup)
    (foo2 ?tup)
    (...))

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcascalog-user @
categoriesclojure, hadoop
postedFeb 2, '12 at 5:04p
activeFeb 4, '12 at 1:58a
posts2
users2
websiteclojure.org
irc#clojure

2 users in discussion

Paul Lam: 1 post Nathanmarz: 1 post

People

Translate

site design / logo © 2022 Grokbase