Changeset: 2e33639ce402 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2e33639ce402
Modified Files:
        gdk/gdk_strimps.h
        monetdb5/modules/mal/pcre.c
Branch: string_imprints
Log Message:

Do not create strimps for small bats


diffs (32 lines):

diff --git a/gdk/gdk_strimps.h b/gdk/gdk_strimps.h
--- a/gdk/gdk_strimps.h
+++ b/gdk/gdk_strimps.h
@@ -15,6 +15,7 @@
 #define STRIMP_VERSION (uint64_t)1
 #define STRIMP_HISTSIZE 256*256
 #define STRIMP_HEADER_SIZE 64
+#define STRIMP_CREATION_THRESHOLD 5000 /* do not create strimp for "small" 
BATs */
 
 typedef struct {
        uint8_t *pbytes;
diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c
--- a/monetdb5/modules/mal/pcre.c
+++ b/monetdb5/modules/mal/pcre.c
@@ -1886,13 +1886,14 @@ PCRElikeselect(bat *ret, const bat *bid,
 
        assert(ATOMstorage(b->ttype) == TYPE_str);
 
-       if (use_strimps) {
+       if (use_strimps && BATcount(b) >= STRIMP_CREATION_THRESHOLD) {
                if (STRMPcreate(b, NULL) == GDK_SUCCEED) {
                        BAT *tmp_s;
                        tmp_s = STRMPfilter(b, s, *pat);
-                       if(s)
+                       if (tmp_s && s) {
                                BBPunfix(s->batCacheid);
-                       s = tmp_s;
+                               s = tmp_s;
+                       }
                } /* If we cannot create the strimp just continue normally */
 
        }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to