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

Modified Files:
        opt_const.c 
Log Message:
-- Introduced a rewrite for the la_serialize_rel operator.
-- For plans that use the la_serialize_rel operator, we ensure (analogous to 
the existing rewrite for la_serialize_seq) that attributes with constant values 
are introduced at the latest possible point in the plan.

Index: opt_const.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_const.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- opt_const.c 10 Dec 2007 15:10:00 -0000      1.24
+++ opt_const.c 13 Dec 2007 22:08:55 -0000      1.25
@@ -139,6 +139,48 @@
             }
             break;
 
+
+    case la_serialize_rel:
+
+            /* Introduce (superfluous) attach-ops for constant attributes. 
+               This rewrite ensures, that constants are introduced at 
+               the latest possible point in the plan.
+            */
+
+            /* Rewrite for the iter-attribute. */
+            if (PFprop_const_left (p->prop, p->sem.ser_rel.iter)) {
+                L(p) = add_attach (L(p), p->sem.ser_rel.iter,
+                                   PFprop_const_val_left (
+                                       p->prop,
+                                       p->sem.ser_rel.iter));
+
+            }
+
+            /* Rewrite for the pos-attribute. */
+            if (PFprop_const_left (p->prop, p->sem.ser_rel.pos)) {
+                L(p) = add_attach (L(p), p->sem.ser_rel.pos,
+                                   PFprop_const_val_left (
+                                       p->prop,
+                                       p->sem.ser_rel.pos));
+            }
+
+            /* Rewrite for the item-attributes. */
+            PFalg_attlist_t items = p->sem.ser_rel.items;
+            unsigned int count = items.count;
+            for (unsigned int i = 0; i < count; i++)
+            {
+                PFalg_att_t item = items.atts[i];
+                if (PFprop_const_left (p->prop, item)) {
+                    L(p) = add_attach (L(p), item,
+                                       PFprop_const_val_left (
+                                           p->prop,
+                                           item));
+                }
+            }
+
+            break;
+
+
         case la_eqjoin:
         {   /**
              * If both join columns are constant


-------------------------------------------------------------------------
SF.Net email is sponsored by:
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