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

xid.c: exploit and maintain dense columns


diffs (54 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
@@ -149,22 +149,30 @@ XIDcompress(Client cntxt, MalBlkPtr mb, 
        BUN i=0;
        lng clk;
        str msg = MAL_SUCCEED;
+       int ht, tt;
 
        (void) mb;
        if ((b = BATdescriptor(*bid)) == NULL)
                throw(MAL, "xid.compress", INTERNAL_BAT_ACCESS);
-       if ( isVIEW(b) || BATcount(b) == 0){
+       ht = b->htype;
+       tt = b->ttype;
+       assert(ATOMtype(ht) == TYPE_oid && ATOMtype(tt) == TYPE_oid);
+       if ( isVIEW(b) || BATcount(b) == 0 || (ht == TYPE_void && tt == 
TYPE_void) ) {
                mnstr_printf(cntxt->fdout,"#xid %s view %d\n",(BATcount(b)==0 ? 
"empty":""), getArg(pci,1));
                BBPkeepref(*ret = b->batCacheid);
                return MAL_SUCCEED;
        }
-       bn = BATnew(b->htype,b->ttype, BATcount(b)+1);
+       if (BAThdense(b))
+               ht = TYPE_void;
+       if (BATtdense(b))
+               tt = TYPE_void;
+       bn = BATnew(ht,tt, BATcount(b)+1);
        if (bn == NULL) {
                BBPreleaseref(b->batCacheid);
                throw(MAL,"xid.compress", MAL_MALLOC_FAIL);
        }
 
-       if ( b->ttype == TYPE_oid){
+       if ( tt == TYPE_oid){
                p = (oid*)Tloc(b,BUNfirst(b));
                q = (oid*)Tloc(b,BUNlast(b));
                col = (XIDcolumn) bn->T->heap.base;
@@ -197,7 +205,7 @@ XIDcompress(Client cntxt, MalBlkPtr mb, 
        bn->T->nil = b->T->nil;
        bn->T->seq = b->T->seq;
 
-       if ( b->htype == TYPE_oid){
+       if ( ht == TYPE_oid){
                p = (oid*)Hloc(b,BUNfirst(b));
                q = (oid*)Hloc(b,BUNlast(b));
                col = (XIDcolumn) bn->H->heap.base;
@@ -284,6 +292,7 @@ XIDdecompress(Client cntxt, MalBlkPtr mb
        (void) mb;
        if ((b = BATdescriptor(*bid)) == NULL)
                throw(MAL, "xid.decompress", INTERNAL_BAT_ACCESS);
+       assert(ATOMtype(b->htype) == TYPE_oid && ATOMtype(b->ttype) == 
TYPE_oid);
        if ( isVIEW(b)){
                BBPkeepref(*ret = b->batCacheid);
                return MAL_SUCCEED;
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to