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

Modified Files:
      Tag: XQuery_0-22
        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.

   NOTE: Do not propagate as conflicts may arise.
         (I will check in the fix into the head myself.)


U prop_key.c
Index: prop_key.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_key.c,v
retrieving revision 1.38
retrieving revision 1.38.2.1
diff -u -d -r1.38 -r1.38.2.1
--- prop_key.c  1 Feb 2008 13:32:02 -0000       1.38
+++ prop_key.c  27 Mar 2008 09:33:57 -0000      1.38.2.1
@@ -422,7 +422,6 @@
             break;
 
         case la_select:
-        case la_pos_select:
         case la_difference:
         case la_type_assert:
         case la_roots:
@@ -431,6 +430,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);
@@ -546,7 +555,10 @@
             break;
 
         case la_guide_step:
-            if ((n->sem.step.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.axis == alg_chld ||
                  n->sem.step.axis == alg_attr ||
                  n->sem.step.axis == alg_self) &&
                 find_guide_max (n->sem.step.guide_count,
@@ -571,6 +583,7 @@
 
         case la_guide_step_join:
             if ((n->sem.step.axis == alg_chld ||
+            /* copy existing keys if the cardinality does not change */
                  n->sem.step.axis == alg_attr ||
                  n->sem.step.axis == alg_self) &&
                 find_guide_max (n->sem.step.guide_count,


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