Update of /cvsroot/monetdb/pathfinder/compiler/semantics
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv16576

Modified Files:
      Tag: Nov2009
        heuristic.c 
Log Message:
make index rewrite more selective:
- patterns inside function invocations lead to an algebra translation 
  that loop-lifts the index lookup, which we want to avoid.

(fixes MBench/qa05 timeout)



Index: heuristic.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/semantics/heuristic.c,v
retrieving revision 1.15.6.4
retrieving revision 1.15.6.5
diff -u -d -r1.15.6.4 -r1.15.6.5
--- heuristic.c 12 Nov 2009 01:45:19 -0000      1.15.6.4
+++ heuristic.c 16 Nov 2009 18:18:21 -0000      1.15.6.5
@@ -400,6 +400,7 @@
     {  0, p_attribute },
     {  0, p_attribute }
 };
+#define REV_AXIS(x) rev_axis[((x) <= 15)?(x):15]
 
 #define skip_over_emptyseq(p) skip(p,0)
 #define skip_to_locpath(p)    skip(p,1)
@@ -430,7 +431,7 @@
         }
         if (p->kind != p_locpath || L(p)->kind != p_step) break;
 
-        rev_axis_t a = rev_axis[L(p)->sem.kind];
+        rev_axis_t a = REV_AXIS(L(p)->sem.kind);
         if (a.id == p_attribute) return NULL;
 
         /* protect (a bit) against reverted locpaths that are 
@@ -538,7 +539,7 @@
 
     /* check txt/attr predicate and ensure it is the left child of eq */
     PFpnode_t *req_name = nil;
-    int tst = check_predicate(L(p), &req_name);
+    int i,j,tst = check_predicate(L(p), &req_name);
     if (!tst) {
         tst = check_predicate(R(p), &req_name);
         if (tst) {
@@ -549,6 +550,11 @@
            return 0;
         }
     }
+    /* prohibition on a loop-lifted function application on lookup result, as 
it forces looplifted index evaluation */
+    for(i=j=0; i<depth; i++) {
+        if (stack[i]->kind == p_flwr) j = 1;
+        if (j && stack[i]->kind == p_fun_ref) return 0;
+    }
 
     /* I do support conjunctions in PRED, EXPR1 */
     while(depth > 0 && stack[depth-1]->kind == p_and) depth--;


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to