Changeset: 4bc9c5336c6f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4bc9c5336c6f
Modified Files:
        MonetDB/src/gdk/gdk_batop.mx
        MonetDB/src/gdk/gdk_relop.mx
Branch: Oct2010
Log Message:

reduced number of times we call BATaccess

in hashselect we should call it.
in default fetch join we only call BATaccess on the right side if
the left part of the fetch join is at least 10% of the right side.


diffs (42 lines):

diff -r 655d4ff0f17c -r 4bc9c5336c6f MonetDB/src/gdk/gdk_batop.mx
--- a/MonetDB/src/gdk/gdk_batop.mx      Thu Oct 14 22:33:41 2010 +0200
+++ b/MonetDB/src/gdk/gdk_batop.mx      Thu Oct 14 22:35:12 2010 +0200
@@ -991,7 +991,6 @@
                BBPreclaim(bn);
                return NULL;
        }
-       BATaccessBegin(b, USE_HEAD | USE_HHASH | USE_TAIL, MMAP_WILLNEED);
        while (bn) {
                BUN q = BUNfirst(bn);
                BUN r;
@@ -1012,7 +1011,6 @@
                BBPreclaim(bn);
                bn = BATnew(ht, tt, size);
        }
-       BATaccessEnd(b, USE_HEAD | USE_HHASH | USE_TAIL, MMAP_WILLNEED);
        return bn;
 }
 
diff -r 655d4ff0f17c -r 4bc9c5336c6f MonetDB/src/gdk/gdk_relop.mx
--- a/MonetDB/src/gdk/gdk_relop.mx      Thu Oct 14 22:33:41 2010 +0200
+++ b/MonetDB/src/gdk/gdk_relop.mx      Thu Oct 14 22:35:12 2010 +0200
@@ -809,7 +809,8 @@
 @= defaultvoidfetchjoin
        ALGODEBUG THRprintf(GDKout, "#BATfetchjoin: 
defaultvoidfetchjoin(@1);\n");
        BATaccessBegin(l, USE_TAIL, MMAP_SEQUENTIAL);
-       BATaccessBegin(r, USE_TAIL, MMAP_WILLNEED);
+       if (BATcount(l) > (BATcount(r)/10)) 
+               BATaccessBegin(r, USE_TAIL, MMAP_WILLNEED);
        BATloop(l, l_cur, l_end) {
                BUN _yy = (BUN) (offset + * (oid *) BUNtloc(li, l_cur));
 
@@ -824,7 +825,8 @@
                dst++;
        }
        BATaccessEnd(l, USE_TAIL, MMAP_SEQUENTIAL);
-       BATaccessEnd(r, USE_TAIL, MMAP_WILLNEED);
+       if (BATcount(l) > (BATcount(r)/10)) 
+               BATaccessEnd(r, USE_TAIL, MMAP_WILLNEED);
        if (nondense) {
                BATiter bni; 
                /* not (yet?) completely type-optimized ! */
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to