Changeset: a1771862d046 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a1771862d046
Modified Files:
gdk/gdk_group.c
gdk/gdk_select.c
gdk/gdk_unique.c
Branch: default
Log Message:
Consider building hash for "persistent" bats when running in memory.
diffs (50 lines):
diff --git a/gdk/gdk_group.c b/gdk/gdk_group.c
--- a/gdk/gdk_group.c
+++ b/gdk/gdk_group.c
@@ -1034,7 +1034,8 @@ BATgroup_internal(BAT **groups, BAT **ex
GDKfree(pgrp);
} else if (g == NULL &&
(BATcheckhash(b) ||
- (!bi.transient &&
+ ((!bi.transient ||
+ (b->batRole == PERSISTENT && GDKinmemory(0))) &&
BAThash(b) == GDK_SUCCEED) ||
(/* DISABLES CODE */ (0) &&
(parent = VIEWtparent(b)) != 0 &&
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -1608,7 +1608,8 @@ BATselect(BAT *b, BAT *s, const void *tl
}
}
wanthash = havehash ||
- (!bi.transient &&
+ ((!bi.transient ||
+ (b->batRole == PERSISTENT && GDKinmemory(0))) &&
ATOMsize(bi.type) >= sizeof(BUN) / 4 &&
bi.count * (ATOMsize(bi.type) + 2 * sizeof(BUN)) <
GDK_mem_maxsize / 2);
if (!wanthash) {
@@ -1660,7 +1661,9 @@ BATselect(BAT *b, BAT *s, const void *tl
MT_lock_unset(&pb->theaplock);
}
if (!phash &&
- (!pbi.transient || wantphash) &&
+ (!pbi.transient ||
+ wantphash ||
+ (pb->batRole == PERSISTENT && GDKinmemory(0))) &&
pbi.count == bi.count &&
BAThash(pb) == GDK_SUCCEED) {
MT_rwlock_rdlock(&pb->thashlock);
diff --git a/gdk/gdk_unique.c b/gdk/gdk_unique.c
--- a/gdk/gdk_unique.c
+++ b/gdk/gdk_unique.c
@@ -174,7 +174,8 @@ BATunique(BAT *b, BAT *s)
TIMEOUT_CHECK(timeoffset,
GOTO_LABEL_TIMEOUT_HANDLER(bunins_failed));
} else if (BATcheckhash(b) ||
- (!bi.transient &&
+ ((!bi.transient ||
+ (b->batRole == PERSISTENT && GDKinmemory(0))) &&
ci.ncand == bi.count &&
BAThash(b) == GDK_SUCCEED)) {
BUN lo = 0;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]