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

Modified Files:
        algopt.c planner.c 
Log Message:
-- Added a new optimization phase that is based on the required node
   properties (introduced some days ago):

   o The optimization phase unnests constant constructors if neither
     their order nor their ids are needed. The following query

       for $a in 1 to 1000 return <a>42</a>

     is rewritten (on the algebraic level) into something comparable to

       let $foo := <a>42</a> return for $a in 1 to 1000 return $foo

     A constant tree is thus created only once.

   o A further optimization removes the merge adjacent text nodes
     operator in case the nodes are never queried. This leads to
     results that consist of (potentially) more text nodes than
     allowed. The serialization however will hide that fact.


U algopt.c
Index: algopt.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/algopt.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- algopt.c    3 Apr 2008 12:37:12 -0000       1.33
+++ algopt.c    4 Apr 2008 09:45:13 -0000       1.34
@@ -258,6 +258,19 @@
                            PFtimer_str (tm));
                 break;
 
+            case 'N':
+                MAP_ORI_NAMES("required nodes optimization")
+
+                tm = PFtimer_start ();
+
+                root = PFalgopt_req_node (root);
+
+                tm = PFtimer_stop (tm);
+                if (timing)
+                    PFlog ("   required nodes optimization:\t    %s",
+                           PFtimer_str (tm));
+                break;
+
             case 'Q':
                 MAP_ORI_NAMES("join-graph optimization")
                 proxies_involved = false;

U planner.c
Index: planner.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/planner.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- planner.c   3 Apr 2008 09:42:13 -0000       1.58
+++ planner.c   4 Apr 2008 09:45:13 -0000       1.59
@@ -1784,7 +1784,8 @@
                        *(plan_t **) PFarray_at (R(n)->plans, i),
                        sortby (iter, pos)));
 
-    if (!PFprop_node_content_queried (n->prop, att_item))
+    if (PFprop_node_property (n->prop, att_item) &&
+        !PFprop_node_content_queried (n->prop, att_item))
         /* for each plan, generate a constructor */
         for (unsigned int i = 0; i < PFarray_last (ordered_in); i++)
             add_plan (ret,


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to