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

Modified Files:
        prop_key.c 
Log Message:
-- Fixed wrong property inference (-- we cannot get a key out of nowhere).

-- Extended property inference for positional selections to compensate the
   ``restriction'' for the above fix.


U prop_key.c
Index: prop_key.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_key.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- prop_key.c  26 Mar 2008 11:25:55 -0000      1.43
+++ prop_key.c  27 Mar 2008 09:34:11 -0000      1.44
@@ -413,7 +413,6 @@
             break;
 
         case la_select:
-        case la_pos_select:
         case la_difference:
         case la_type_assert:
         case la_roots:
@@ -422,6 +421,16 @@
             /* key columns are propagated */
             copy (n->prop->keys, L(n)->prop->keys);
             break;
+            
+        case la_pos_select:
+            /* key columns are propagated */
+            copy (n->prop->keys, L(n)->prop->keys);
+            
+            /* propagate the partition column as there can
+               be only one matching position for every partition */
+            if (n->sem.pos_sel.part)
+                union_ (n->prop->keys, n->sem.pos_sel.part);
+            break;
 
         case la_intersect:
             copy (n->prop->keys, L(n)->prop->keys);
@@ -537,7 +546,10 @@
             break;
 
         case la_guide_step:
-            if ((n->sem.step.spec.axis == alg_chld ||
+            /* copy the iter key if it exists and the cardinality
+               does not change */               
+            if (PFprop_key (R(n)->prop, n->sem.step.iter) &&
+                (n->sem.step.spec.axis == alg_chld ||
                  n->sem.step.spec.axis == alg_attr ||
                  n->sem.step.spec.axis == alg_self) &&
                 find_guide_max (n->sem.step.guide_count,
@@ -562,6 +574,7 @@
             break;
 
         case la_guide_step_join:
+            /* copy existing keys if the cardinality does not change */
             if ((n->sem.step.spec.axis == alg_chld ||
                  n->sem.step.spec.axis == alg_attr ||
                  n->sem.step.spec.axis == alg_self) &&


-------------------------------------------------------------------------
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