Update of /cvsroot/monetdb/pathfinder/compiler/algebra/opt
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6600/algebra/opt

Modified Files:
        opt_complex.c opt_guide.c opt_icol.c opt_monetxq.c opt_mvd.c 
        opt_set.c 
Log Message:
-- Introduced a new column-name-origin property that enhances the column names
   in the DOT generated algebra plans. If a column stems from a ref_tbl or a
   path step we now keep the original name throughout the plan.
   (Use pf-option -fN to print the mapping of original names.)

-- Make property usage a little bit more defensive. Instead of !PFprop_icol
   a new function PFprop_not_icol is introduced that copes correctly with
   missing property information.


Index: opt_icol.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_icol.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- opt_icol.c  7 Jan 2010 15:24:27 -0000       1.35
+++ opt_icol.c  17 Mar 2010 21:56:26 -0000      1.36
@@ -185,7 +185,7 @@
 
         case la_attach:
             /* prune attach if result column is not required */
-            if (!PFprop_icol (p->prop, p->sem.attach.res)) {
+            if (PFprop_not_icol (p->prop, p->sem.attach.res)) {
                 *p = *PFla_dummy (L(p));
                 break;
             }
@@ -275,7 +275,7 @@
 
         case la_fun_1to1:
             /* prune generic function operator if result column is not 
required */
-            if (!PFprop_icol (p->prop, p->sem.fun_1to1.res)) {
+            if (PFprop_not_icol (p->prop, p->sem.fun_1to1.res)) {
                 *p = *PFla_dummy (L(p));
                 break;
             }
@@ -286,7 +286,7 @@
         case la_bool_and:
         case la_bool_or:
             /* prune binary operation if result column is not required */
-            if (!PFprop_icol (p->prop, p->sem.binary.res)) {
+            if (PFprop_not_icol (p->prop, p->sem.binary.res)) {
                 *p = *PFla_dummy (L(p));
                 break;
             }
@@ -294,7 +294,7 @@
 
         case la_bool_not:
             /* prune unary operation if result column is not required */
-            if (!PFprop_icol (p->prop, p->sem.unary.res)) {
+            if (PFprop_not_icol (p->prop, p->sem.unary.res)) {
                 *p = *PFla_dummy (L(p));
                 break;
             }
@@ -335,7 +335,7 @@
         case la_rank:
             /* prune rownum, rowrank, or rank if the result
                column is not required */
-            if (!PFprop_icol (p->prop, p->sem.sort.res)) {
+            if (PFprop_not_icol (p->prop, p->sem.sort.res)) {
                 *p = *PFla_dummy (L(p));
                 break;
             }
@@ -343,7 +343,7 @@
 
         case la_rowid:
             /* prune rowid if result column is not required */
-            if (!PFprop_icol (p->prop, p->sem.rowid.res)) {
+            if (PFprop_not_icol (p->prop, p->sem.rowid.res)) {
                 *p = *PFla_dummy (L(p));
                 break;
             }
@@ -353,7 +353,7 @@
             /* prune type if result column is not required */
         case la_cast:
             /* prune cast if result column is not required */
-            if (!PFprop_icol (p->prop, p->sem.type.res)) {
+            if (PFprop_not_icol (p->prop, p->sem.type.res)) {
                 *p = *PFla_dummy (L(p));
                 break;
             }
@@ -362,7 +362,7 @@
         case la_type_assert:
             /* prune type assertion if restricted column is not
                used afterwards */
-            if (!PFprop_icol (p->prop, p->sem.type.col)) {
+            if (PFprop_not_icol (p->prop, p->sem.type.col)) {
                 *p = *PFla_dummy (L(p));
                 break;
             }
@@ -373,7 +373,7 @@
 
         case la_doc_access:
             /* prune doc_access if result column is not required */
-            if (!PFprop_icol (p->prop, p->sem.doc_access.res)) {
+            if (PFprop_not_icol (p->prop, p->sem.doc_access.res)) {
                 *p = *PFla_dummy (R(p));
                 break;
             }
@@ -382,7 +382,7 @@
         case la_roots:
             /* prune twig if result column is not required */
             if (L(p)->kind == la_twig &&
-                !PFprop_icol (p->prop, L(p)->sem.iter_item.item))
+                PFprop_not_icol (p->prop, L(p)->sem.iter_item.item))
                 switch (LL(p)->kind) {
 
                     case la_docnode:
@@ -430,7 +430,7 @@
                         assert(0);
                 }
             else if (L(p)->kind == la_doc_tbl &&
-                     !PFprop_icol (L(p)->prop, L(p)->sem.doc_tbl.res)) {
+                     PFprop_not_icol (L(p)->prop, L(p)->sem.doc_tbl.res)) {
                 *p = *PFla_dummy (LL(p));
                 break;
             }
@@ -440,20 +440,20 @@
             if (L(p)->kind == la_fragment &&
                 LL(p)->kind == la_twig &&
                 LLL(p)->kind != la_textnode && /* retain textnodes */
-                !PFprop_icol (LL(p)->prop, LL(p)->sem.iter_item.item))
+                PFprop_not_icol (LL(p)->prop, LL(p)->sem.iter_item.item))
                 *p = *PFla_dummy (R(p));
             else if (R(p)->kind == la_fragment &&
                 RL(p)->kind == la_twig &&
                 RLL(p)->kind != la_textnode && /* retain textnodes */
-                !PFprop_icol (RL(p)->prop, RL(p)->sem.iter_item.item))
+                PFprop_not_icol (RL(p)->prop, RL(p)->sem.iter_item.item))
                 *p = *PFla_dummy (L(p));
             else if (L(p)->kind == la_fragment &&
                 LL(p)->kind == la_doc_tbl &&
-                !PFprop_icol (LL(p)->prop, LL(p)->sem.doc_tbl.res))
+                PFprop_not_icol (LL(p)->prop, LL(p)->sem.doc_tbl.res))
                 *p = *PFla_dummy (R(p));
             else if (R(p)->kind == la_fragment &&
                 RL(p)->kind == la_doc_tbl &&
-                !PFprop_icol (RL(p)->prop, RL(p)->sem.doc_tbl.res))
+                PFprop_not_icol (RL(p)->prop, RL(p)->sem.doc_tbl.res))
                 *p = *PFla_dummy (L(p));
             break;
 

Index: opt_guide.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_guide.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- opt_guide.c 7 Jan 2010 15:24:27 -0000       1.21
+++ opt_guide.c 17 Mar 2010 21:56:26 -0000      1.22
@@ -289,7 +289,7 @@
                   n->sem.step.spec.axis == alg_self) &&
                  find_guide_max (n->sem.step.guide_count,
                                  n->sem.step.guides) <= 1)) &&
-                !PFprop_icol (n->prop, n->sem.step.item))
+                PFprop_not_icol (n->prop, n->sem.step.item))
                 merge_guide_steps (n);
             break;
 

Index: opt_set.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_set.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- opt_set.c   7 Jan 2010 15:24:27 -0000       1.19
+++ opt_set.c   17 Mar 2010 21:56:28 -0000      1.20
@@ -218,7 +218,7 @@
         case la_step:
             if (PFprop_set (p->prop) &&
                 PFprop_icol (p->prop, p->sem.step.item) &&
-                !PFprop_icol (p->prop, p->sem.step.iter))
+                PFprop_not_icol (p->prop, p->sem.step.iter))
                 *p = *PFla_step (
                           L(p),
                           PFla_attach (
@@ -276,7 +276,7 @@
         case la_guide_step:
             if (PFprop_set (p->prop) &&
                 PFprop_icol (p->prop, p->sem.step.item) &&
-                !PFprop_icol (p->prop, p->sem.step.iter))
+                PFprop_not_icol (p->prop, p->sem.step.iter))
                 *p = *PFla_guide_step (
                           L(p),
                           PFla_attach (

Index: opt_complex.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_complex.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- opt_complex.c       7 Jan 2010 15:24:27 -0000       1.86
+++ opt_complex.c       17 Mar 2010 21:56:19 -0000      1.87
@@ -1839,7 +1839,7 @@
                 for (i = 0; i < p->schema.count; i++) {
                     proj2[i] = PFalg_proj (p->schema.items[i].name,
                                            p->schema.items[i].name);
-                    if (!PFprop_icol (p->prop, p->schema.items[i].name)) {
+                    if (PFprop_not_icol (p->prop, p->schema.items[i].name)) {
                         for (j = 0; j < p->schema.count; j++)
                             if (i != j &&
                                 PFprop_icol (p->prop, p->schema.items[j].name) 
&&
@@ -2237,7 +2237,7 @@
                and ensure that the column generated by the nested
                row number operator is not used above the outer rank. */
             if (rank->kind == la_rank &&
-                !PFprop_icol (p->prop, rank->sem.sort.res)) {
+                PFprop_not_icol (p->prop, rank->sem.sort.res)) {
 
                 PFord_ordering_t sortby;
                 PFalg_proj_t *proj_list;
@@ -2358,7 +2358,7 @@
                        elsewhere. */
                     for (j = 0; j < clsize (collist); j++)
                         if (clat (collist, j) == p->sem.rowid.res ||
-                            !PFprop_icol (p->prop, clat (collist, j)))
+                            PFprop_not_icol (p->prop, clat (collist, j)))
                             break;
                     if (j == clsize (collist)) {
                         PFord_ordering_t sortby = PFordering ();
@@ -2466,7 +2466,7 @@
             else if (R(p)->kind == la_rowid &&
                      p->sem.step.spec.axis == alg_chld &&
                      p->sem.step.iter == R(p)->sem.rowid.res &&
-                     !PFprop_icol (p->prop, p->sem.step.iter) &&
+                     PFprop_not_icol (p->prop, p->sem.step.iter) &&
                      PFprop_key (p->prop, p->sem.step.item)) {
                 R(p) = PFla_attach (RL(p),
                                     R(p)->sem.rowid.res,
@@ -2544,7 +2544,7 @@
                   p->sem.step.spec.kind != node_kind_node &&
                   p->sem.step.spec.kind != node_kind_doc)) &&
                 RL(p)->sem.step.spec.kind == node_kind_node &&
-                !PFprop_icol (p->prop, p->sem.step.item) &&
+                PFprop_not_icol (p->prop, p->sem.step.item) &&
                  /* set ok as rewrite can only result in equal or less rows */
                 (PFprop_set (p->prop) ||
                  PFprop_ckey (p->prop, p->schema) ||
@@ -2617,7 +2617,7 @@
                   p->sem.step.spec.kind != node_kind_node &&
                   p->sem.step.spec.kind != node_kind_doc)) &&
                 R(p)->sem.step.spec.kind == node_kind_node &&
-                !PFprop_icol (p->prop, p->sem.step.item) &&
+                PFprop_not_icol (p->prop, p->sem.step.item) &&
                  /* set ok as rewrite can only result in equal or less rows */
                 (PFprop_set (p->prop) ||
                  PFprop_ckey (p->prop, p->schema) ||

Index: opt_monetxq.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_monetxq.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- opt_monetxq.c       7 Jan 2010 15:24:27 -0000       1.12
+++ opt_monetxq.c       17 Mar 2010 21:56:28 -0000      1.13
@@ -102,7 +102,7 @@
                visible column and thus that the pattern is
                not nested in a for loop. */
             if (PFprop_set (p->prop) &&
-                !PFprop_icol (p->prop, p->sem.step.item_res) &&
+                PFprop_not_icol (p->prop, p->sem.step.item_res) &&
                 p->sem.step.spec.axis == alg_chld &&
                 p->sem.step.spec.kind != node_kind_node &&
                 p->sem.step.spec.kind != node_kind_doc) {

Index: opt_mvd.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_mvd.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- opt_mvd.c   7 Jan 2010 15:24:27 -0000       1.57
+++ opt_mvd.c   17 Mar 2010 21:56:28 -0000      1.58
@@ -1913,10 +1913,16 @@
     /* re-route operators in case the underlying
        rowid operator is ignored by the DAG-branch. */
     if (L(p) && L(p)->kind == la_rowid &&
+        /* We know that no new rowid operators without properties
+           are introduced and thus !PFprop_icol... still returns
+           the correct result. */
         !PFprop_icol_left (p->prop, L(p)->sem.rowid.res)) {
         L(p) = PFla_attach (LL(p), L(p)->sem.rowid.res, PFalg_lit_nat(1));
     }
     if (R(p) && R(p)->kind == la_rowid &&
+        /* We know that no new rowid operators without properties
+           are introduced and thus !PFprop_icol... still returns
+           the correct result. */
         !PFprop_icol_right (p->prop, R(p)->sem.rowid.res)) {
         R(p) = PFla_attach (RL(p), R(p)->sem.rowid.res, PFalg_lit_nat(1));
     }


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to