Changeset: 36a70ccfdd13 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=36a70ccfdd13
Modified Files:
        gdk/gdk_select.c
Branch: partioned-hash
Log Message:

When using hashselect, only create hash on parent bat if it is persistent.


diffs (38 lines):

diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -168,14 +168,28 @@ BAT_hashselect(BAT *b, BAT *s, BAT *bn, 
        assert(bn->ttype == TYPE_oid);
        assert(BAThdense(b));
        seq = b->hseqbase;
+       l = BUNfirst(b);
+       h = BUNlast(b);
        if (VIEWtparent(b)) {
                BAT *b2 = BBPdescriptor(-VIEWtparent(b));
-               l = (BUN) ((b->T->heap.base - b2->T->heap.base) >> b->T->shift) 
+ BUNfirst(b);
-               h = l + BATcount(b);
-               b = b2;
-       } else {
-               l = BUNfirst(b);
-               h = BUNlast(b);
+               if (b2->batPersistence == PERSISTENT || BATcheckhash(b2)) {
+                       /* only use parent's hash if it is persistent
+                        * or already has a hash */
+                       ALGODEBUG
+                               fprintf(stderr, "#hashselect(%s#"BUNFMT"): "
+                                       "using parent(%s#"BUNFMT") for hash\n",
+                                       BATgetId(b), BATcount(b),
+                                       BATgetId(b2), BATcount(b2));
+                       l = (BUN) ((b->T->heap.base - b2->T->heap.base) >> 
b->T->shift) + BUNfirst(b);
+                       h = l + BATcount(b);
+                       b = b2;
+               } else {
+                       ALGODEBUG
+                               fprintf(stderr, "#hashselect(%s#"BUNFMT"): not "
+                                       "using parent(%s#"BUNFMT") for hash\n",
+                                       BATgetId(b), BATcount(b),
+                                       BATgetId(b2), BATcount(b2));
+               }
        }
        if (s && BATtdense(s)) {
                /* no need for binary search in s, we just adjust the
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to