Changeset: 428241f48a2c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=428241f48a2c
Modified Files:
        monetdb5/modules/mal/xid.c
Branch: xid
Log Message:

XIDcompress(): do not invest in compressing BATs smaller than MIN_INPUT_COUNT 
(== 1000) BUNs


diffs (34 lines):

diff --git a/monetdb5/modules/mal/xid.c b/monetdb5/modules/mal/xid.c
--- a/monetdb5/modules/mal/xid.c
+++ b/monetdb5/modules/mal/xid.c
@@ -31,6 +31,9 @@
 /* maximal compressed size relative to original size */
 #define MAX_COMPRESSED_SIZE (org_size / 2)
 
+/* do not invest in compressing BATs smaller than this */
+#define MIN_INPUT_COUNT 1000
+
 #define XIDPOINT    0
 #define XIDSETINC   1
 #define XIDSETDEC   2
@@ -404,9 +407,9 @@ XIDcompress(Client cntxt, MalBlkPtr mb, 
        cnt = BATcount(b);
        ht = b->htype;
        tt = b->ttype;
-       if ( isVIEWCOMBINE(b) || cnt == 0 || (ht == TYPE_void && tt != 
TYPE_oid) || (ht != TYPE_oid && tt == TYPE_void) ) {
+       if ( isVIEWCOMBINE(b) || cnt < MIN_INPUT_COUNT || (ht == TYPE_void && 
tt != TYPE_oid) || (ht != TYPE_oid && tt == TYPE_void) ) {
                /* no need to compress */
-               mnstr_printf(cntxt->fdout,"#xid %s view variable %d\n",(cnt==0 
? "empty":""), getArg(pci,1));
+               mnstr_printf(cntxt->fdout,"#xid view (count = "BUNFMT") 
variable %d\n",cnt, getArg(pci,1));
                BBPkeepref(*ret = b->batCacheid);
                return MAL_SUCCEED;
        }
@@ -432,7 +435,7 @@ XIDcompress(Client cntxt, MalBlkPtr mb, 
        }
        if ( (!skip_h && htx == TYPE_oid && VIEWhparent(b)) || (!skip_t && ttx 
== TYPE_oid && VIEWtparent(b)) ) {
                /* no need to compress */
-               mnstr_printf(cntxt->fdout,"#xid %s view variable %d\n",(cnt==0 
? "empty":""), getArg(pci,1));
+               mnstr_printf(cntxt->fdout,"#xid view (count = "BUNFMT") 
variable %d\n",cnt, getArg(pci,1));
                BBPkeepref(*ret = b->batCacheid);
                return MAL_SUCCEED;
        }
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to