Update of /cvsroot/monetdb/pathfinder/compiler/mil
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19005/compiler/mil

Modified Files:
        milprint_summer.c 
Log Message:
-- Changed the Core translation rules (that translate the parse tree
   into the Core tree). This fixes a long known deficiency in Pathfinder:
     We now correctly evaluate positional predicate on reverse axis.
   'ancestor::*[1]' now becomes the parent of the context node instead
   of the root node ('(ancestor::*)[1]').

-- Added an implementation of fn:reverse in mps to support positional
   predicates on reverse axes.

-- Disabled a rewrite in mps that became to expensive for some of the 
   queries in the testweb (MBench qj01 and qj03).


Index: milprint_summer.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/milprint_summer.c,v
retrieving revision 1.398
retrieving revision 1.399
diff -u -d -r1.398 -r1.399
--- milprint_summer.c   17 Jul 2007 12:45:06 -0000      1.398
+++ milprint_summer.c   23 Jul 2007 16:17:21 -0000      1.399
@@ -7868,6 +7868,19 @@
     {
         return evaluate_join (f, code, cur_level, counter, args);
     }
+    else if (!PFqname_eq(fnQname, PFqname (PFns_fn,"reverse")))
+    {
+        translate2MIL (f, NORMAL, cur_level, counter, L(args));
+        milprintf(f,
+                "{ # translate fn:reverse (item*) as item*\n"
+                "var sort := iter.tsort().CTrefine_rev(pos).hmark([EMAIL 
PROTECTED]);\n"
+                "iter := sort.leftfetchjoin (iter);\n"
+                "pos := tmark_grp_unique (iter, iter);\n"
+                "item := sort.leftfetchjoin (item);\n"
+                "ipik := sort;\n"
+                "} # end of translate fn:reverse (item*) as item*\n");
+        return NORMAL;
+    }
     else if (!PFqname_eq(fnQname, PFqname (PFns_fn,"unordered")))
     {
         milprintf(f, "# ignored fn:unordered\n");
@@ -9624,6 +9637,11 @@
             }
             break;
         case c_for:
+            /* FIXME: disable the following rewrite as this breaks
+               the evaluation of some queries. A more advanced check
+               is needed if avoiding this rewrite decreases 
+               the performance of some queries. */
+#if 0
             /* 
                 for $x in for $y in e
                           return e_y
@@ -9647,6 +9665,7 @@
                 TY(R(c)) = *PFty_simplify ((PFty_quantifier (PFty_defn 
(TY(RLR(c))))) (TY(RR(c))));
                 TY(c) = *PFty_simplify ((PFty_quantifier (PFty_defn 
(TY(LR(c))))) (TY(R(c))));
             }
+#endif
 
             simplifyCoreTree (LR(c));
             simplifyCoreTree (R(c));


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to