Update of /cvsroot/monetdb/pathfinder/runtime
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv15655/runtime

Modified Files:
      Tag: PF_ROX
        pf_support.mx ll_staircasejoin.mx 
Log Message:

implemented result-size limit ("cutoff") also for downward staircase-join
(ll_child(), ll_descendant(), ll_descendant_or_self()):

when provided with a limit ("cutoff"), the downward staircase-joins
will produce a result that is no larger than "cutoff";
in addition to the actual result, the downward step-joins
now return an estimate how large the result might have been,
in case all (left-)input node had been consumed;

in case no limit was given (cutoff == int(nil) or cutoff < 0),
or on case the actual result is smaller than the cutoff,
the estimate is the exact result size.

TODO:
implement cutoff also for upward staircase-joins
(ll_parent(), ll_ancestor(), ll_ancestor_or_self())


Index: ll_staircasejoin.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/ll_staircasejoin.mx,v
retrieving revision 1.61
retrieving revision 1.61.4.1
diff -u -d -r1.61 -r1.61.4.1
--- ll_staircasejoin.mx 11 Jan 2008 10:47:19 -0000      1.61
+++ ll_staircasejoin.mx 20 Feb 2008 08:57:37 -0000      1.61.4.1
@@ -76,19 +76,22 @@
 @:ll_proto(descendant)@
 @:ll_head(descendant,FALSE)@
     self = FALSE;
-    res_size = BATcount(iter_bat);     /* FIXME: estimate size! */
+    if (res_size == 0)
+        res_size = BATcount(iter_bat); /* FIXME: estimate size! */
 @:ll_main(descendant, (size[pre] & (1<<31)))@
 
 /* DESCENDANT-OR-SELF STEP */
 @:ll_head(descendant_or_self,FALSE)@
     self = TRUE;
-    res_size = BATcount(iter_bat);     /* FIXME: estimate size! */
+    if (res_size == 0)
+        res_size = BATcount(iter_bat); /* FIXME: estimate size! */
 @:ll_main(descendant, (size[pre] & (1<<31)))@
 
 /* CHILD STEP */
 @:ll_proto(child)@
 @:ll_head(child,TRUE)@
-    res_size = BATcount(iter_bat);     /* FIXME: estimate size! */
+    if (res_size == 0)
+        res_size = BATcount(iter_bat); /* FIXME: estimate size! */
 @:ll_main(child, FALSE)@
 
 /* Templates / Wrappers */
@@ -96,13 +99,13 @@
 @= ll_proto
 static int
 [EMAIL PROTECTED] (    BAT **res, BAT *iter_bat, BAT *ctx_bat, BAT *end_ctx, 
BAT *cand_bat, int *size,
-       oid min_iter, oid max_iter, bit no_iter_order, bit self, chr* kind, chr 
kind_test);
+       oid min_iter, oid max_iter, bit no_iter_order, bit self, chr* kind, chr 
kind_test, size_t cutoff, size_t *estimate);
 @
 @= ll_head
 int
 [EMAIL PROTECTED] (BAT **result, BAT *iter_bat, BAT *ctx_bat, BAT *end_ctx, 
BAT *pre_size, BAT *cand_bat,
         bit *_one_iter, bit *_one_ctx,
-        oid *_min_iter, oid *_max_iter, bit *_no_iter_order, chr *_kind_test)
+        oid *_min_iter, oid *_max_iter, bit *_no_iter_order, chr *_kind_test, 
int *_cutoff)
 {
     /* --------------------------- declarations ---------------------------- */
 
@@ -112,13 +115,16 @@
     oid min_iter = *_min_iter;
     oid max_iter = *_max_iter;
     bit no_iter_order = *_no_iter_order;
+    size_t cutoff = ((*_cutoff < 0) ? 0 : (size_t)*_cutoff);
     bit self = FALSE;
     bit child_step = @2;
     chr *kind = NULL, kind_test = *_kind_test;
     BAT *res = NULL;
     BAT *del = NULL;
-    size_t res_size = 0;
+    size_t res_size = cutoff;
     int *size;
+    size_t estimate = 0;
+    int _estimate = 0;
 
     /* --------------------------- checks ---------------------------------- */
 
@@ -202,6 +208,8 @@
     }
     size = ((int*) Tloc(pre_size, BUNfirst(pre_size))) - 
(int)pre_size->hseqbase;
 
+    *result = NULL;
+
     /* --------------------------- empty result ---------------------------- */
 
     if (BATcount(iter_bat) == 0 || BATcount(pre_size) == 0 || (cand_bat && 
BATcount(cand_bat) == 0))
@@ -216,7 +224,10 @@
         res->tdense = TRUE;
         BATseqbase (BATmirror(res), (oid)0); /* does not really matter */
         BATset(res, TRUE);
-        *result = res;
+        _estimate = 0;
+        *result = BATnew(TYPE_int, TYPE_bat, 1);
+       bunfastins (*result, (void*) &_estimate, (void*) &res->batCacheid);
+       BBPunfix(res->batCacheid);
         @:ll_return(GDK_SUCCEED)@
     }
 @
@@ -236,22 +247,36 @@
         oid lst_ctx = 0;
         oid *sdst = 0, *hdst = 0, *tdst = 0;
         size_t max_size = 0;
+        size_t free, decr;
+            
+        if (cutoff > 0) {
+            free = cutoff;
+            decr = 1; 
+        } else {
+            free = 1;
+            decr = 0; 
+        }
 
         assert((size[fst_ctx] & (1<<31)) == 0);
-        max_size = res_size = (size_t)(size[fst_ctx] + (int)self);
-        if ( cand_bat ) {
-            if ( BATcount(cand_bat) < res_size ) {
-                res_size = BATcount(cand_bat);
+        max_size = (size_t)(size[fst_ctx] + (int)self);
+        if (cutoff == 0) {
+            res_size = max_size;
+            if ( cand_bat ) {
+                if ( BATcount(cand_bat) < res_size ) {
+                    res_size = BATcount(cand_bat);
+                }
             }
+            res_size *= BATcount(iter_bat);
+        } else {
+            res_size = cutoff;
         }
-        res_size *= BATcount(iter_bat);
         res = BATnew(TYPE_oid, TYPE_oid, res_size);
         if (res == NULL) 
         { 
             GDKerror("%s: could not allocate a result BAT[oid,void] of size " 
SZFMT ".\n", name, res_size);
             @:ll_return(GDK_FAIL)@
         }
-        res_size /= BATcount(iter_bat);
+        /* res_size /= BATcount(iter_bat); */
         fst_ctx = fst_ctx + (oid)(1 - (int)self);
         lst_ctx = fst_ctx + (oid)max_size;
         sdst = hdst = (oid*)Hloc(res, BUNlast(res));
@@ -264,9 +289,10 @@
             if ( one_iter ) {
                 oid iter = *(oid*)BUNtail(iter_bati, BUNfirst(iter_bat));
 
-                for (cand = fst_cand ; cand < lst_cand && *cand < lst_ctx; 
cand++) {
+                for (cand = fst_cand ; cand < lst_cand && *cand < lst_ctx && 
free > 0; cand++) {
                     *hdst++ = iter;
                     *tdst++ = *cand;
+                    free -= decr;
                 }
             } else 
             {   /* multiple iters */
@@ -274,13 +300,17 @@
                 BUN fst_iter = BUNfirst(iter_bat);
                 BUN lst_iter = BUNlast(iter_bat);
                     
-                for (cand = fst_cand ; cand < lst_cand && *cand < lst_ctx; 
cand++) {
-                    for (iter = fst_iter ; iter < lst_iter; iter++) {
+                for (cand = fst_cand ; cand < lst_cand && *cand < lst_ctx && 
free > 0; cand++) {
+                    for (iter = fst_iter ; iter < lst_iter && free > 0; 
iter++) {
                         *hdst++ = *(oid*)BUNtail(iter_bati,iter);
                         *tdst++ = *cand;
+                        free -= decr;
                     }
                 }
             }
+            if (free == 0) {
+                estimate = (size_t)(((dbl)(lst_cand - fst_cand) / (dbl)(cand - 
fst_cand)) * (dbl)cutoff);
+            }
         } else 
         {   /* !cands */ 
             oid pre = 0;
@@ -288,10 +318,11 @@
             if ( one_iter ) {
                 oid iter = *(oid*)BUNtail(iter_bati, BUNfirst(iter_bat));
 
-                for (pre = fst_ctx ; pre < lst_ctx ; pre++ ) {
+                for (pre = fst_ctx ; pre < lst_ctx && free > 0 ; pre++ ) {
                     if ((kind && kind[pre] != kind_test) || @2) continue; 
                     *hdst++ = iter;
                     *tdst++ = pre;
+                    free -= decr;
                 }
             } else 
             {   /* multiple iters */
@@ -299,14 +330,18 @@
                 BUN fst_iter = BUNfirst(iter_bat);
                 BUN lst_iter = BUNlast(iter_bat);
                 
-                for (pre = fst_ctx ; pre < lst_ctx ; pre++ ) {
+                for (pre = fst_ctx ; pre < lst_ctx && free > 0 ; pre++ ) {
                     if ((kind && kind[pre] != kind_test) || @2) continue; 
-                    for (iter = fst_iter ; iter < lst_iter; iter ++) {
+                    for (iter = fst_iter ; iter < lst_iter && free > 0; iter 
++) {
                         *hdst++ = *(oid*)BUNtail(iter_bati,iter);
                         *tdst++ = pre;
+                        free -= decr;
                     }
                 }
             }
+            if (free == 0) {
+                estimate = (size_t)(((dbl)(lst_ctx - fst_ctx) / (dbl)(pre - 
fst_ctx)) * (dbl)cutoff);
+            }
         }
         BATsetcount(res, hdst-sdst);
     } else
@@ -323,7 +358,7 @@
         }
 
         if ([EMAIL PROTECTED](&res, iter_bat, ctx_bat, end_ctx, cand_bat, 
size, 
-                  min_iter, max_iter, no_iter_order, self, kind, kind_test) == 
GDK_FAIL )
+                  min_iter, max_iter, no_iter_order, self, kind, kind_test, 
cutoff, &estimate) == GDK_FAIL )
         {
             @:ll_return(GDK_FAIL)@
         }
@@ -360,9 +395,23 @@
     BATkey(BATmirror(res),(res->tdense||one_iter)); /* might be TRUE in some 
more cases... */
     BATset(res, TRUE);
 }
-    *result = res;
+    if (estimate == 0)
+        estimate = BATcount(res);
+    if (estimate < (size_t) GDK_int_max)
+        _estimate = (int) estimate;
+    else
+        _estimate = GDK_int_max;
+    *result = BATnew(TYPE_int, TYPE_bat, 1);
+    bunfastins (*result, (void*) &_estimate, (void*) &res->batCacheid);
+    BBPunfix(res->batCacheid);
 
     @:ll_return(GDK_SUCCEED)@
+
+bunins_failed:
+    if (*result)
+        BBP_unfix_reclaim(*result);
+    *result = NULL;
+    @:ll_return(GDK_FAIL)@
 }
 @
 
@@ -417,7 +466,7 @@
 
 static int
 ll_child ( BAT **result, BAT *iter_bat, BAT *ctx_bat, BAT *end_ctx, BAT 
*cand_bat, int* size,
-             oid min_iter, oid max_iter, bit no_iter_order, bit self, chr 
*kind, chr kind_test)
+             oid min_iter, oid max_iter, bit no_iter_order, bit self, chr 
*kind, chr kind_test, size_t cutoff, size_t* estimate)
 {
     BATiter ctx_bati = bat_iterator(ctx_bat), end_ctxi = bat_iterator(end_ctx);
     BATiter iter_bati = bat_iterator(iter_bat);
@@ -429,6 +478,15 @@
     BUN ctx_bun = 0, ctx_last = 0;
     oid *cand_cur = (oid*)(cand_bat?Tloc(cand_bat,BUNfirst(cand_bat)):NULL);
     oid *cand_lst = (oid*)(cand_bat?Tloc(cand_bat,BUNlast(cand_bat)-1):NULL);
+    size_t free, decr;
+        
+    if (cutoff > 0) {
+        free = cutoff;
+        decr = 1; 
+    } else {
+        free = 1;
+        decr = 0; 
+    }
 
     /* not used, here; keep compilers happy */
     (void)min_iter;
@@ -481,7 +539,7 @@
        starting from the ctx (on the top of the stack) until
        the next ctx node (or the end of the stack top
        ctx node scope) is reached */
-    while (ctx_bun < ctx_last && cand_cur <= cand_lst) {
+    while (ctx_bun < ctx_last && cand_cur <= cand_lst && free > 0) {
         ctx = *(oid*)BUNtail(ctx_bati,ctx_bun);
         /* if the stack is empty the next ctx node
            has to be pushed on the stack 
@@ -518,7 +576,7 @@
     /* need to process the ctx nodes, which are still on the stack 
        - only need to evaluate the inner loop and pop, because 
          there are no more new ctx nodes */
-    while (stack_top) {
+    while (stack_top && free > 0) {
         @:inner_loop_child(stack[stack_top-1].eocs,@1,@2)@
         @:popctx@
     }
@@ -535,7 +593,7 @@
 
             for (; pre <= @1 && pre < *fst_pre; pre += (size[pre]&GDK_int_max) 
+ 1) { 
             }
-            for (;              pre <= lst_pre; pre += (size[pre]&GDK_int_max) 
+ 1)
+            for (; free > 0  && pre <= lst_pre; pre += (size[pre]&GDK_int_max) 
+ 1)
               if ((size[pre] & (1<<31)) == 0) {
 
                 /* poor man's binary search / exploiting forward scan */
@@ -559,13 +617,13 @@
         for (; pre <= @1; pre += (size[pre]&GDK_int_max) + 1) {
         }
     } else if (kind) {
-        for (; pre <= @1; pre += (size[pre]&GDK_int_max) + 1) {
+        for (; pre <= @1 && free > 0; pre += (size[pre]&GDK_int_max) + 1) {
             if ((size[pre] & (1<<31)) == 0 && kind[pre] == kind_test) {
                 @:inner_loop_child_body(@2,@3)@
             }
         }
     } else {
-        for (; pre <= @1; pre += (size[pre]&GDK_int_max) + 1) {
+        for (; pre <= @1 && free > 0; pre += (size[pre]&GDK_int_max) + 1) {
             if ((size[pre] & (1<<31)) == 0) {
                 @:inner_loop_child_body(@2,@3)@
             }
@@ -590,12 +648,14 @@
                 *hdst++ = next_iter;
                 *tdst++ = pre;
                 prev_iter = next_iter;
+                free -= decr;
             }
 @
 @= no_duplicates_body
             oid next_iter = *(oid*)BUNtail(iter_bati,cur_idx);
             *hdst++ = next_iter;
             *tdst++ = pre;
+            free -= decr;
 @
 @= inner_loop_child_body
         @1
@@ -611,7 +671,7 @@
         tdst = (oid*)Tloc(res, BUNlast(res));
         if (end_ctx) {
             for (cur_idx = stack[stack_top-1].first;
-                 cur_idx <= stack[stack_top-1].last;
+                 cur_idx <= stack[stack_top-1].last && free > 0;
                  cur_idx++) {
                 if (pre < *(oid*)BUNtail(end_ctxi,cur_idx)) {
                     @2
@@ -619,7 +679,7 @@
             }
         } else {
             for (cur_idx = stack[stack_top-1].first;
-                 cur_idx <= stack[stack_top-1].last;
+                 cur_idx <= stack[stack_top-1].last && free > 0;
                  cur_idx++) {
                 @2
             }
@@ -629,6 +689,10 @@
 @c
 
     GDKfree(stack);
+    if (free == 0) {
+        BUN ctx_fst = BUNfirst(ctx_bat);
+        *estimate = (size_t)(((dbl)(ctx_last - ctx_fst) / (dbl)(ctx_bun - 
ctx_fst)) * (dbl)cutoff);
+    }
     *result = res;    
     return GDK_SUCCEED;
 bunins_failed:
@@ -656,7 +720,7 @@
 
 static int
 ll_descendant ( BAT **result, BAT *iter_bat, BAT *ctx_bat, BAT *end_ctx, BAT 
*cand_bat, int* size,
-                oid min_iter, oid max_iter, bit no_iter_order, bit self, chr* 
kind, chr kind_test)
+                oid min_iter, oid max_iter, bit no_iter_order, bit self, chr* 
kind, chr kind_test, size_t cutoff, size_t *estimate)
 {
     BATiter ctx_bati = bat_iterator(ctx_bat), iter_bati = 
bat_iterator(iter_bat);
     BAT *res = *result;
@@ -673,6 +737,15 @@
     int OST_bits  = OST_bytes * 8;
     int OST_mask  = OST_bits - 1;
     int OST_shift = 0;
+    size_t free, decr;
+        
+    if (cutoff > 0) {
+        free = cutoff;
+        decr = 1; 
+    } else {
+        free = 1;
+        decr = 0; 
+    }
 
     /* not used, here; keep compilers happy */
     (void)end_ctx;
@@ -766,14 +839,14 @@
        starting from the ctx (on the top of the stack) until
        the next ctx node (or the end of the stack top
        ctx node scope) is reached */
-    while (ctx_bun < ctx_last && cnd <= lst_cnd) {
+    while (ctx_bun < ctx_last && cnd <= lst_cnd && free > 0) {
         oid cur_ctx = ctx;
         /* scan over all iters for the current ctx node;
            only a new (non-active) iters have to be added
            to the list of active iters */
         pre = ctx;
         @:skip_cands_before_pre@
-        while (ctx_bun < ctx_last) {
+        while (ctx_bun < ctx_last && free > 0) {
             ctx = *(oid*)BUNtail(ctx_bati,ctx_bun);
             iter_idx = *(oid*)BUNtail(iter_bati,iter_bun) - min_iter;
             if (ctx != cur_ctx)
@@ -788,6 +861,7 @@
                     if (pre == cnd && ((kind == NULL) || (kind[pre] == 
kind_test))) {
                         oid iter = min_iter + iter_idx;
                         bunfastins(res, &iter, &pre);
+                       free -= decr;
                     }
                 }
             }
@@ -796,7 +870,7 @@
         }
         @:sort_iters_on_stack@
         pre++;
-        if (ctx_bun < ctx_last) {
+        if (ctx_bun < ctx_last && free > 0) {
             if (ctx <= stack[stack_top-1].eocs) {
                 /* find all results between the current ctx node
                    and the next (descendant) ctx node */
@@ -805,10 +879,10 @@
             } else {
                 /* successively finish all active scopes
                    that do not contain the next ctx node */
-                while (stack_top && stack[stack_top-1].eocs <= ctx) {
+                while (stack_top && stack[stack_top-1].eocs <= ctx && free > 
0) {
                     @:finish_scope_descendant@
                 }
-                if (ctx <= stack[stack_top-1].eocs) {
+                if (ctx <= stack[stack_top-1].eocs && free > 0) {
                     @:inner_loop_descendant(ctx)@
                 }
             }
@@ -817,7 +891,7 @@
     /* need to process the ctx nodes, which are still on the stack 
        - only need to evaluate the inner loop and pop, because 
          there are no more new ctx nodes */
-    while (stack_top) {
+    while (stack_top && free > 0) {
         @:finish_scope_descendant@
     }
 
@@ -826,7 +900,7 @@
     /* find all results in the current scope */
     @:inner_loop_descendant(eocs)@
     /* back to enclosing scope: remove all iters that are done */
-    while (stack_top && stack[stack_top-1].eocs <= eocs) {
+    while (stack_top && stack[stack_top-1].eocs <= eocs && free > 0) {
         stack_top--;
         onstack_clr(stack[stack_top].iter_idx);
     }
@@ -856,18 +930,20 @@
             oid *fst_pre = cnd_ptr;
             oid *lst_pre = (oid*)Tloc(cand_bat, BUNlast(cand_bat));
                             
-            for (cur_pre = fst_pre ; cur_pre < lst_pre && *cur_pre <= lst_ctx; 
cur_pre++) {
+            for (cur_pre = fst_pre ; cur_pre < lst_pre && *cur_pre <= lst_ctx 
&& free > 0; cur_pre++) {
                 for (j = 0 ; j < stack_top ; j++ ) {
                     *hdst++ = iters_on_stack[j];
                     *tdst++ = *cur_pre;
+                    free -= decr;
                 }
             }
         } else {
-            for ( ; pre <= @1 ; pre++ ) {
+            for ( ; pre <= @1 && free > 0 ; pre++ ) {
                 if ((kind && kind[pre] != kind_test) || (size[pre] & (1<<31))) 
continue; 
-                for (j = 0 ; j < stack_top ; j++ ) {
+                for (j = 0 ; j < stack_top && free > 0 ; j++ ) {
                     *hdst++ = iters_on_stack[j];
                     *tdst++ = pre;
+                    free -= decr;
                 }
             }
         }
@@ -888,6 +964,10 @@
     GDKfree(onstack);
     GDKfree(iters_on_stack);
     
+    if (free == 0) {
+        BUN ctx_fst = BUNfirst(ctx_bat);
+        *estimate = (size_t)(((dbl)(ctx_last - ctx_fst) / (dbl)(ctx_bun - 
ctx_fst)) * (dbl)cutoff);
+    }
     *result = res;    
     return GDK_SUCCEED;
 bunins_failed:

Index: pf_support.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/pf_support.mx,v
retrieving revision 1.277.4.4
retrieving revision 1.277.4.5
diff -u -d -r1.277.4.4 -r1.277.4.5
--- pf_support.mx       20 Feb 2008 00:41:46 -0000      1.277.4.4
+++ pf_support.mx       20 Feb 2008 08:57:36 -0000      1.277.4.5
@@ -346,7 +346,7 @@
 returns an [int,BAT]-BAT with a single BUN;
 head: estimated result size, in case result was cut off; actual result size, 
otherwise;
 tail: [oid,oid]-BAT with all pairs of positions/IDs ([l_pre.head, r_pre.head]) 
such that
-(l_pre.tail STEP r_pre.tail) holds and {[l_prune.tail, r_pre.tail]} is 
distinct."
+      (l_pre.tail STEP r_pre.tail) holds and {[l_prune.tail, r_pre.tail]} is 
distinct."
 @
 @m
 @:ll_cmd(descendant)@
@@ -361,7 +361,8 @@
                    BAT[void,any] cands,
                    bit one_iter, bit one_ctx,
                    oid min_iter, oid max_iter,
-                   bit no_iter_order, chr kind_test): BAT[oid,oid] = [EMAIL 
PROTECTED];
+                   bit no_iter_order, chr kind_test,
+                   int cutoff): BAT[int,BAT] = [EMAIL PROTECTED];
 "PARAMETERS:
 BAT[void,oid] iter (grouping relation; sorted on tail within each ctx group)
 BAT[void,oid] ctx (context set; sorted on tail)
@@ -374,8 +375,11 @@
 oid           min_iter,max_iter (smallest and largest iter id)
 bit           no_iter_order (descendant & descendant_or_self, only: 
                result will be ordered on item, but not sub-ordered on iter)
+int           cutoff (result size limit; int(nil) or <=0  =>  no limit)
 DESCRIPTION:
-returns all nodes on the @1 axis of the ctx-nodes duplicate free for each 
group."
+returns an [int,BAT]-BAT with a single BUN;
+head: estimated result size, in case result was cut off; actual result size, 
otherwise;
+tail: [oid,oid]-BAT with all nodes on the @1 axis of the ctx-nodes duplicate 
free for each group."
 @
 @m
 @:ll_upwards(parent,parent)@
@@ -1489,10 +1493,10 @@
                     res.chk_order();
                 }
 @= wrap
-PROC [EMAIL PROTECTED](BAT[oid,oid] iter, BAT[oid,oid] ctx, BAT[oid,int] 
pre_size, BAT[void,any] cands, bit one_iter, bit one_ctx, oid min_iter, oid 
max_iter, bit no_iter_order, chr kind_test) : BAT[oid,oid]
+PROC [EMAIL PROTECTED](BAT[oid,oid] iter, BAT[oid,oid] ctx, BAT[oid,int] 
pre_size, BAT[void,any] cands, bit one_iter, bit one_ctx, oid min_iter, oid 
max_iter, bit no_iter_order, chr kind_test, int cutoff) : BAT[oid,oid]
 {
         var end_ctx := bat(void,oid,0).seqbase([EMAIL 
PROTECTED]).access(BAT_READ);
-       return [EMAIL PROTECTED](iter, ctx, end_ctx, pre_size, cands, one_iter, 
one_ctx, min_iter, max_iter, no_iter_order, kind_test);
+       return [EMAIL PROTECTED](iter, ctx, end_ctx, pre_size, cands, one_iter, 
one_ctx, min_iter, max_iter, no_iter_order, kind_test, cutoff);
 }
 ADDHELP("[EMAIL PROTECTED]", "manegold", "Aug 2007",
 "PARAMETERS:\n\
@@ -1505,8 +1509,11 @@
 oid           min_iter,max_iter (smallest and largest iter id)\n\
 bit           no_iter_order (descendant & descendant_or_self, only: \n\
                result will be ordered on item, but not sub-ordered on iter)\n\
+int           cutoff (result size limit; int(nil) or <=0  =>  no limit)
 DESCRIPTION:\n\
-returns all nodes on the @1 axis of the ctx-nodes duplicate free for each 
group.",
+returns an [int,BAT]-BAT with a single BUN;
+head: estimated result size, in case result was cut off; actual result size, 
otherwise;
+tail: [oid,oid]-BAT with all nodes on the @1 axis of the ctx-nodes duplicate 
free for each group.",
 "pf_support");
 
 PROC @1 (BAT[oid,oid] iter, BAT[oid,oid] item, oid cont, BAT[oid,bat] ws, int 
order, BAT[void,any] cands, chr kind_test) : BAT[void,bat]
@@ -1598,7 +1605,7 @@
        # the actual location step
        if ( isnil(result) ) {
                var res := [EMAIL PROTECTED] (iter, item, end_ctx, pre_size, 
cands, one_iter, one_item, 
-                                  min_iter, max_iter, (and(order,2) = 0), 
kind_test);
+                                  min_iter, max_iter, (and(order,2) = 0), 
kind_test, int(nil)).fetch(0);
                                
                 @:resolve_unique_iters()@
 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to