Changeset: 49b6aaaab42d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/49b6aaaab42d
Modified Files:
        monetdb5/modules/kernel/bat5.c
Branch: Dec2025
Log Message:

Remove some weird collision stats from bat.info (which is not used anyway).


diffs (76 lines):

diff --git a/monetdb5/modules/kernel/bat5.c b/monetdb5/modules/kernel/bat5.c
--- a/monetdb5/modules/kernel/bat5.c
+++ b/monetdb5/modules/kernel/bat5.c
@@ -572,13 +572,6 @@ BKCgetAccess(Client ctx, str *res, const
  * Where necessary use the primary view to access the properties
  */
 static inline char *
-pre(const char *s1, const char *s2, char *buf)
-{
-       snprintf(buf, 64, "%s%s", s1, s2);
-       return buf;
-}
-
-static inline char *
 local_itoa(ssize_t i, char *buf)
 {
        snprintf(buf, 32, "%zd", i);
@@ -631,45 +624,15 @@ infoHeap(BAT *bk, BAT *bv, Heap *hp, con
        return GDK_SUCCEED;
 }
 
-#define COLLISION (8 * sizeof(size_t))
-
 static gdk_return
-HASHinfo(BAT *bk, BAT *bv, Hash *h, const char *s)
+HASHinfo(BAT *bk, BAT *bv, Hash *h)
 {
-       BUN i;
-       BUN j;
-       BUN k;
-       BUN cnt[COLLISION + 1];
-       char buf[32];
-       char prebuf[64];
-
-       if (BUNappend(bk, pre(s, "type", prebuf), false) != GDK_SUCCEED ||
+       if (BUNappend(bk, "thash->type", false) != GDK_SUCCEED ||
                BUNappend(bv, ATOMname(h->type), false) != GDK_SUCCEED ||
-               BUNappend(bk, pre(s, "mask", prebuf), false) != GDK_SUCCEED ||
-               BUNappend(bv, local_utoa(h->nbucket, buf), false) != 
GDK_SUCCEED)
+               BUNappend(bk, "thash->mask", false) != GDK_SUCCEED ||
+               BUNappend(bv, local_utoa(h->nbucket, (char[32]){0}), false) != 
GDK_SUCCEED)
                return GDK_FAIL;
 
-       for (i = 0; i < COLLISION + 1; i++) {
-               cnt[i] = 0;
-       }
-       for (i = 0; i < h->nbucket; i++) {
-               j = HASHlist(h, i);
-               for (k = 0; j; k++)
-                       j >>= 1;
-               cnt[k]++;
-       }
-
-       for (i = 0; i < COLLISION + 1; i++)
-               if (cnt[i]) {
-                       if (BUNappend(bk,
-                                                 pre(s, local_utoa(i ? 
(((size_t) 1) << (i - 1)) : 0,
-                                                                               
        buf),
-                                                         prebuf),
-                                                 false) != GDK_SUCCEED
-                               || BUNappend(bv, local_utoa((size_t) cnt[i], 
buf),
-                                                        false) != GDK_SUCCEED)
-                               return GDK_FAIL;
-               }
        return GDK_SUCCEED;
 }
 
@@ -804,7 +767,7 @@ BKCinfo(Client ctx, bat *ret1, bat *ret2
        }
        /* dump index information */
        MT_rwlock_rdlock(&b->thashlock);
-       if (b->thash && HASHinfo(bk, bv, b->thash, "thash->") != GDK_SUCCEED) {
+       if (b->thash && HASHinfo(bk, bv, b->thash) != GDK_SUCCEED) {
                MT_rwlock_rdunlock(&b->thashlock);
                bat_iterator_end(&bi);
                BBPreclaim(bk);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to