Changeset: 0d84e7ee13e5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0d84e7ee13e5
Modified Files:
        gdk/ChangeLog.Jun2020
        gdk/gdk_hash.c
Branch: Jun2020
Log Message:

Widen hash buckets if BAT gets too long for its BUNs to fit in the buckets.


diffs (26 lines):

diff --git a/gdk/ChangeLog.Jun2020 b/gdk/ChangeLog.Jun2020
--- a/gdk/ChangeLog.Jun2020
+++ b/gdk/ChangeLog.Jun2020
@@ -1,3 +1,8 @@
 # ChangeLog file for GDK
 # This file is updated with Maddlog
 
+* Tue Jun  9 2020 Sjoerd Mullender <[email protected]>
+- Hash buckets come in variable widths.  But if a BAT grows long enough so
+  that the BAT indexes that are stored in the buckets don't fit anymore,
+  the buckets need to be widened.  This is now fixed.
+
diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c
--- a/gdk/gdk_hash.c
+++ b/gdk/gdk_hash.c
@@ -1019,6 +1019,10 @@ HASHins_locked(BAT *b, BUN i, const void
                doHASHdestroy(b, h);
                return;
        }
+       if (HASHwidth(i + 1) > h->width &&
+            HASHupgradehashheap(b) != GDK_SUCCEED) {
+               return;
+       }
        if ((ATOMsize(b->ttype) > 2 &&
             HASHgrowbucket(b) != GDK_SUCCEED) ||
            ((i + 1) * h->width > h->heaplink.size &&
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to