Changeset: a10485eb6234 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a10485eb6234
Modified Files:
        monetdb5/extras/crackers/crackers_AVL_index.mx
        monetdb5/extras/crackers/crackers_core_ordered.mx
        monetdb5/extras/crackers/crackers_core_unordered.mx
        monetdb5/extras/crackers/crackers_crackmerge.mx
        monetdb5/extras/crackers/crackers_index.mx
        monetdb5/extras/crackers/crackers_joins.mx
        monetdb5/extras/crackers/crackers_joinselect_ops.mx
        monetdb5/extras/crackers/crackers_partial_sideways.mx
        monetdb5/extras/crackers/crackers_populate.mx
        monetdb5/extras/crackers/crackers_select_ops.mx
        monetdb5/extras/crackers/crackers_sideways.mx
        monetdb5/extras/crackers/crackers_sortmerge.mx
        monetdb5/extras/crackers/crackers_updates.mx
        monetdb5/extras/crackers/crackers_validation.mx
        monetdb5/extras/rdf/rdf_shredder.mx
        monetdb5/mal/Tests/performanceTests/tst901b.mal
        monetdb5/mal/Tests/tst901b.mal
        monetdb5/mal/Tests/tst901b.stable.out
        monetdb5/mal/Tests/tst902.mal
        monetdb5/mal/Tests/tst902.stable.out
        monetdb5/mal/mal_authorize.c
        monetdb5/mal/mal_dataflow.c
        monetdb5/mal/mal_debugger.c
        monetdb5/mal/mal_interpreter.c
        monetdb5/mal/mal_listing.c
        monetdb5/mal/mal_profiler.c
        monetdb5/mal/mal_recycle.c
        monetdb5/mal/mal_runtime.c
        monetdb5/modules/atoms/colxml.c
        monetdb5/modules/atoms/mtime.c
        monetdb5/modules/kernel/aggr.mx
        monetdb5/modules/kernel/aggr_be_avg.mx
        monetdb5/modules/kernel/aggr_be_count.mx
        monetdb5/modules/kernel/aggr_be_minmax.mx
        monetdb5/modules/kernel/aggr_be_prod.mx
        monetdb5/modules/kernel/aggr_be_sum.mx
        monetdb5/modules/kernel/aggr_bge_avg.mx
        monetdb5/modules/kernel/aggr_bge_count.mx
        monetdb5/modules/kernel/aggr_bge_minmax.mx
        monetdb5/modules/kernel/aggr_bge_prod.mx
        monetdb5/modules/kernel/aggr_bge_sum.mx
        monetdb5/modules/kernel/aggr_ri.mx
        monetdb5/modules/kernel/algebra.mx
        monetdb5/modules/kernel/array.mx
        monetdb5/modules/kernel/colcalc.mx
        monetdb5/modules/kernel/colcast.mx
        monetdb5/modules/kernel/colcolor.mx
        monetdb5/modules/kernel/colifthen.mx
        monetdb5/modules/kernel/colmmath.mx
        monetdb5/modules/kernel/colmtime.mx
        monetdb5/modules/kernel/colstr.mx
        monetdb5/modules/kernel/column.mx
        monetdb5/modules/kernel/group.mx
        monetdb5/modules/kernel/kprelude.mx
        monetdb5/modules/kernel/microbenchmark.c
        monetdb5/modules/mal/cbp.c
        monetdb5/modules/mal/extensions.c
        monetdb5/modules/mal/groupby.c
        monetdb5/modules/mal/mat.c
        monetdb5/modules/mal/mkey.c
        monetdb5/modules/mal/pcrelib.c
        monetdb5/modules/mal/pqueue.mx
        monetdb5/modules/mal/remote.c
        monetdb5/modules/mal/replication.c
        monetdb5/modules/mal/table_sql.c
        monetdb5/modules/mal/tablet.c
        monetdb5/modules/mal/tokenizer.c
        monetdb5/modules/mal/zorder.c
        monetdb5/optimizer/opt_dictionary.c
        monetdb5/optimizer/opt_joinpath.c
        monetdb5/optimizer/opt_mapreduce.c
        monetdb5/optimizer/opt_prejoin.c
        monetdb5/optimizer/opt_tarantula.c
        monetdb5/scheduler/run_octopus.c
        monetdb5/tests/BugReports/Tests/no.035.mal
        monetdb5/tests/BugReports/Tests/no.035.stable.out
        monetdb5/tests/BugReports/Tests/no.145.prelude.mil
        monetdb5/tests/BugReports/Tests/no.164.mal
        monetdb5/tests/BugReports/Tests/no.164.stable.out
        monetdb5/tests/BugsViaSourgeforce/Tests/ID.642351.stable.out
        monetdb5/tests/gdkTests/Tests/binsearchmultijoin.mal
        monetdb5/tests/gdkTests/Tests/binsearchmultijoin.stable.out
Branch: headless
Log Message:

Finalize easy rewrite of BAT*


diffs (truncated from 10415 to 300 lines):

diff --git a/monetdb5/extras/crackers/crackers_AVL_index.mx 
b/monetdb5/extras/crackers/crackers_AVL_index.mx
--- a/monetdb5/extras/crackers/crackers_AVL_index.mx
+++ b/monetdb5/extras/crackers/crackers_AVL_index.mx
@@ -154,7 +154,7 @@
 
        cur = BUNfirst(u);
        last = BUNlast(u);
-       curPos = BATcount(b)-BATcount(u);
+       curPos = COLcount(b)-COLcount(u);
        while (cur < last){
                addAVLIndex_@1(indexPos,curPos,b);
                cur++;
@@ -462,7 +462,7 @@
        if ((u = COLdescriptor(*uid)) == NULL)
                 throw(MAL, "crackers.delete from AVL index", "Cannot access 
deletions BAT");
 
-        if (BATcount(u) == 0){
+        if (COLcount(u) == 0){
                 BBPunfix(u->batCacheid);
                 return MAL_SUCCEED; /* no qualifying values in the insertions 
*/
         }
diff --git a/monetdb5/extras/crackers/crackers_core_ordered.mx 
b/monetdb5/extras/crackers/crackers_core_ordered.mx
--- a/monetdb5/extras/crackers/crackers_core_ordered.mx
+++ b/monetdb5/extras/crackers/crackers_core_ordered.mx
@@ -93,7 +93,7 @@
         if ((b = COLdescriptor(*bid)) == NULL) 
                 throw(MAL, "crackers.crack_zeroOrdered", "Cannot access 
descriptor");
 
-        msg = CRKcrackOrderedZero_LE_@1(b,*mid, 0, BATcount(b)-1,&pos);
+        msg = CRKcrackOrderedZero_LE_@1(b,*mid, 0, COLcount(b)-1,&pos);
 
         BBPkeepref(b->batCacheid);
         *res = *bid;
@@ -108,7 +108,7 @@
         if ((b = COLdescriptor(*bid)) == NULL) 
                 throw(MAL, "crackers.crack_oneOrdered", "Cannot access 
descriptor");
 
-       msg = CRKcrackOrderedThree_LE_RE_@1(b,*mid,*mid, 0, BATcount(b)-1);
+       msg = CRKcrackOrderedThree_LE_RE_@1(b,*mid,*mid, 0, COLcount(b)-1);
         BBPkeepref(b->batCacheid);
         *res = *bid;
         return msg;
@@ -123,7 +123,7 @@
        if ((b = COLdescriptor(*bid)) == NULL) 
                throw(MAL, "crackers.crack_threeOrdered", "Cannot access 
descriptor");
 
-        msg = CRKcrackOrderedThreeL_LO_RE_@1(b,*low,*hgh, 0, 
BATcount(b)-1,&posl, &posh);
+        msg = CRKcrackOrderedThreeL_LO_RE_@1(b,*low,*hgh, 0, 
COLcount(b)-1,&posl, &posh);
        BBPkeepref(b->batCacheid);
        *res = *bid;
        return msg;
diff --git a/monetdb5/extras/crackers/crackers_core_unordered.mx 
b/monetdb5/extras/crackers/crackers_core_unordered.mx
--- a/monetdb5/extras/crackers/crackers_core_unordered.mx
+++ b/monetdb5/extras/crackers/crackers_core_unordered.mx
@@ -202,7 +202,7 @@
        /* if( sizeof(struct SCRATCH{ oid hdummy; @1 tdummy; } ) != BUNsize(b) )
                 throw(MAL, "crackers.crack_zeroUnordered", "Need more clever 
mapping ");
        */
-        msg = CRKcrackUnorderedZero_LE_@1( b, *mid,(BUN) 0, BATcount(b)-1, 
&pos);
+        msg = CRKcrackUnorderedZero_LE_@1( b, *mid,(BUN) 0, COLcount(b)-1, 
&pos);
 
         BBPkeepref(b->batCacheid);
         *res = *bid;
@@ -224,7 +224,7 @@
         /*if( sizeof(struct SCRATCH{ oid hdummy; @1 tdummy; } ) != BUNsize(b) )
                 throw(MAL, "crackers.crack_threeUnordered", "Need more clever 
mapping ");
        */
-        msg = CRKcrackUnorderedThree_LO_RE_@1( b, *low, *hgh, 0, 
BATcount(b)-1,&posl, &posh);
+        msg = CRKcrackUnorderedThree_LO_RE_@1( b, *low, *hgh, 0, 
COLcount(b)-1,&posl, &posh);
 
         BBPkeepref(b->batCacheid);
         *res = *bid;
@@ -298,7 +298,7 @@
        oid sizeBAT, sizePiece;
        @1 mid;
 
-       sizeBAT   = BATcount(b);
+       sizeBAT   = COLcount(b);
        sizePiece = last - first;
 
        /* if the to be processed tuples are not a significant part of 
@@ -732,16 +732,16 @@
         /* set bounds for the iterator */
        firstBUN = BUNfirst(slice);
         ft   = (@1*)Tloc(slice, firstBUN);
-        tmax = (@1 *)Tloc(slice, firstBUN + BATcount(slice)-1);
+        tmax = (@1 *)Tloc(slice, firstBUN + COLcount(slice)-1);
         fh   = (oid)0;
        last = tmax+1;
 
        firstBUN2 = BUNfirst(partition);
         t0    = (@1 *)Tloc(partition, firstBUN2);
         ft2   = (@1 *)Tloc(partition, firstBUN2);
-        tmax2 = (@1 *)Tloc(partition, firstBUN2 + BATcount(partition)-1);
+        tmax2 = (@1 *)Tloc(partition, firstBUN2 + COLcount(partition)-1);
         fh2   = (oid*)Hloc(partition, firstBUN2);
-        hmax2 = (oid*)Hloc(partition, firstBUN2 + BATcount(partition)-1);
+        hmax2 = (oid*)Hloc(partition, firstBUN2 + COLcount(partition)-1);
        
        while (ft<last){
                if (@8_@7(ft, &hgh,@9@1)){
diff --git a/monetdb5/extras/crackers/crackers_crackmerge.mx 
b/monetdb5/extras/crackers/crackers_crackmerge.mx
--- a/monetdb5/extras/crackers/crackers_crackmerge.mx
+++ b/monetdb5/extras/crackers/crackers_crackmerge.mx
@@ -194,7 +194,7 @@
 @= CrackAndCollectTuples
        current=CrackerIndex[m].smNode;
        resTuplesLocal=0;
-       br=BATnew(TYPE_oid, bo->ttype,BATcount(bo)/10);
+       br=BATnew(TYPE_oid, bo->ttype,COLcount(bo)/10);
        COLmmap(br, STORE_MMAP, STORE_MMAP, STORE_MMAP, STORE_MMAP, 0);
        br->restricted= BAT_READ;
        while(current!=NULL){
@@ -256,7 +256,7 @@
                }
 
                if (vh-vl>0 || (vh-vl==0 && vl==0)){
-                       resslice=BATslice(b,vl,vh+1);
+                       resslice=COLslice(b,vl,vh+1);
                        BATappend(br,resslice,TRUE);
                        BBPunfix(resslice->batCacheid);
                        resTuplesLocal+=vh-vl+1;
@@ -431,7 +431,7 @@
        if (b==NULL)
                throw(MAL, "crackers.crackmerge", "Cannot access slice");
 
-       vh= 
nexNode->pieceBAT!=curNode->pieceBAT?BATcount(b)-1:nexNode->indexPosition;
+       vh= 
nexNode->pieceBAT!=curNode->pieceBAT?COLcount(b)-1:nexNode->indexPosition;
 
        /* find out where in the index the low falls */
        
@@ -466,7 +466,7 @@
        
 
        cl1=vh;
-       
ch1=nexNode->pieceBAT!=curNode->pieceBAT?BATcount(b)-1:nexNode->indexPosition;
+       
ch1=nexNode->pieceBAT!=curNode->pieceBAT?COLcount(b)-1:nexNode->indexPosition;
        @:crkTwoLTree(@1,b,@2,@3)@
 
        if (vl>0) _vl=vl-1; else _vl=vl;                
@@ -526,7 +526,7 @@
                        struct sortMergeNode *smNode;
                        BAT *slice;
                        
-                       slice=BATslice(bo, startSlice, endSlice);
+                       slice=COLslice(bo, startSlice, endSlice);
                        b = BATcopy(slice, bo->htype, bo->ttype, TRUE);
                        BBPunfix(slice->batCacheid);
                        if ( bo->htype == TYPE_void)
@@ -545,7 +545,7 @@
                        smNode=(struct sortMergeNode *)GDKmalloc(sizeof(struct 
sortMergeNode));
                        smNode->merged=0;
                        if (vh-vl>0 || (vh-vl==0 && vl==0)){
-                               resslice=BATslice(b,vl,vh+1);
+                               resslice=COLslice(b,vl,vh+1);
                                BATappend(br,resslice,TRUE);
                                BBPunfix(resslice->batCacheid);
                                resTuples+=vh-vl+1;
@@ -567,10 +567,10 @@
                        }
                        
 
-                       if (endSlice==BATcount(bo))
+                       if (endSlice==COLcount(bo))
                                break;
                        startSlice=endSlice;
-                       
endSlice=endSlice+sliceSize>BATcount(bo)?BATcount(bo):endSlice+sliceSize;
+                       
endSlice=endSlice+sliceSize>COLcount(bo)?COLcount(bo):endSlice+sliceSize;
                }
 @
 
@@ -579,9 +579,9 @@
                        struct sortMergeNode *smNode;
                        BAT *slice;
                        
-                       slice=BATslice(bo, startSlice, endSlice);
-                       b = BATnew(TYPE_oid, bo->ttype, BATcount(slice));
-                       BATsetcount(b,BATcount(slice));
+                       slice=COLslice(bo, startSlice, endSlice);
+                       b = BATnew(TYPE_oid, bo->ttype, COLcount(slice));
+                       BATsetcount(b,COLcount(slice));
 
                        mslice = 
newCrackerIndexSlice_@1(b->batCacheid,b->batCacheid,100);
 
@@ -616,10 +616,10 @@
                        }
                        
 
-                       if (endSlice==BATcount(bo))
+                       if (endSlice==COLcount(bo))
                                break;
                        startSlice=endSlice;
-                       
endSlice=endSlice+sliceSize>BATcount(bo)?BATcount(bo):endSlice+sliceSize;
+                       
endSlice=endSlice+sliceSize>COLcount(bo)?COLcount(bo):endSlice+sliceSize;
                }
                resTuples=offset;
 @
@@ -660,7 +660,7 @@
        if (m == -1){
                oid endSlice,startSlice;
        
-               br=BATnew(TYPE_oid, bo->ttype,BATcount(bo)/10);
+               br=BATnew(TYPE_oid, bo->ttype,COLcount(bo)/10);
                COLmmap(br, STORE_MMAP, STORE_MMAP, STORE_MMAP, STORE_MMAP, 0);
                br->restricted= BAT_READ;
 
@@ -670,7 +670,7 @@
 
                current=NULL;
                startSlice=0;
-               endSlice=sliceSize>BATcount(bo)?BATcount(bo):sliceSize;
+               endSlice=sliceSize>COLcount(bo)?COLcount(bo):sliceSize;
                resTuples=0;
                if (*mode==1){
                        @:firstQueryOriginalCrack(@1)@
diff --git a/monetdb5/extras/crackers/crackers_index.mx 
b/monetdb5/extras/crackers/crackers_index.mx
--- a/monetdb5/extras/crackers/crackers_index.mx
+++ b/monetdb5/extras/crackers/crackers_index.mx
@@ -504,7 +504,7 @@
        ph = (oid*)Hloc(b, BUNlast(b));
        pt = (@1 *)Tloc(b, BUNlast(b));
 
-       count = BATcount(b);
+       count = COLcount(b);
         if (count == (oid)0){
                 @:insertIndexElement(@1, (oid*)Hloc(b, BUNfirst(b)), 
(@1*)Tloc(b, BUNfirst(b)), index, *value)@
                CrackerIndex[m].Tree = (struct Node *)GDKmalloc(sizeof(struct 
Node));
@@ -584,7 +584,7 @@
        ph = (oid*)Hloc(b, BUNlast(b));
        pt = (@1 *)Tloc(b, BUNlast(b));
 
-       count = BATcount(b);
+       count = COLcount(b);
         if (count == 0){
                 @:insertIndexElement(@1, (oid*)Hloc(b, BUNfirst(b)), 
(@1*)Tloc(b, BUNfirst(b)), index, value)@
                CrackerIndex[m].Tree = (struct Node *)GDKmalloc(sizeof(struct 
Node));
diff --git a/monetdb5/extras/crackers/crackers_joins.mx 
b/monetdb5/extras/crackers/crackers_joins.mx
--- a/monetdb5/extras/crackers/crackers_joins.mx
+++ b/monetdb5/extras/crackers/crackers_joins.mx
@@ -89,8 +89,8 @@
 /* Local support functions and macros */
 @= joinestimate
        if (@3 == BUN_NONE) {
-               BUN _lcount = BATcount(l);
-               BUN _rcount = BATcount(r);
+               BUN _lcount = COLcount(l);
+               BUN _rcount = COLcount(r);
                BUN _slices = 0;
 
                /* limit estimate with simple bounds first; only spend effort 
if the join result might be big */
@@ -126,12 +126,12 @@
                        for (_lo = 0; _idx < _slices; _lo += _step) {
                                BUN _size = 0, _hi = _lo + SAMPLE_SLICE_SIZE;
 
-                               l = BATslice(_tmp1, _lo, _hi);  /* slice keeps 
all parent properties */
+                               l = COLslice(_tmp1, _lo, _hi);  /* slice keeps 
all parent properties */
                                if (l == NULL)
                                        return NULL;
                                _tmp2 = @2;     /* @2 = e.g. BATXjoin(l,r) */
                                if (_tmp2) {
-                                       _size = BATcount(_tmp2);
+                                       _size = COLcount(_tmp2);
                                        BBPreclaim(_tmp2);
                                }
                                _tot += (_cnt[_idx++] = _size);
@@ -152,9 +152,9 @@
                                        _sample = MIN(_lcount / 100, (1 << 
SAMPLE_TRESHOLD_LOG) / 3);
                                        _tmp2 = COLsample(_tmp1, _sample);
                                        if (_tmp2) {
-                                               _tmp3 = BATjoin(_tmp2, r, 
BUN_NONE);    /* might be expensive */
+                                               _tmp3 = COLjoin(_tmp2, r, 
BUN_NONE);    /* might be expensive */
                                                if (_tmp3) {
-                                                       _tot = BATcount(_tmp3);
+                                                       _tot = COLcount(_tmp3);
                                                        BBPreclaim(_tmp3);
                                                }
                                                BBPreclaim(_tmp2);
@@ -190,7 +190,7 @@
                 register BUN _p = BUNlast(b);                          \
                if (_p == BUN_MAX) /* reached maximum, can't do more */ \
                        goto bunins_done;                               \
-                if (_p + 1 > BATcapacity(b)) {                         \
+                if (_p + 1 > COLcapacity(b)) {                         \
                         if (limit) {                                   \
                                *limit = (BUN) (b->count * (percdone)); \
                               goto bunins_done;                                
\
@@ -297,7 +297,7 @@
                int logr = 4;
 
                /* 4*log2(r.count) = estimation of the cost of binary search in 
units of scan comparisons */
-               for (i = BATcount(r); i > 0; logr++)
+               for (i = COLcount(r); i > 0; logr++)
                        i >>= 1;
                r_scan = logr;  /* opportunistic scan window in r */
        }
@@ -382,7 +382,7 @@
        {
                 BUN yy;
 
-                BATloop(l, p, q) {
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to