Update of /cvsroot/monetdb/pathfinder/compiler/algebra/prop
In directory
sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv26852/compiler/algebra/prop
Modified Files:
Tag: PF_ROX
prop_guide.c prop_key.c prop_ocol.c
Log Message:
propagated changes of Tuesday Mar 25 2008 - Thursday Mar 27 2008
from the development trunk to the PF_ROX branch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/03/25 - tsheyar: compiler/algebra/opt/opt_general.brg,1.49
-- More consistency checks.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/03/26 - tsheyar: compiler/algebra/planner.c,1.56
-- align physical planning for attribute steps
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/03/26 - tsheyar: compiler/algebra/opt/opt_algebra_cse.c,1.29
-- Fixed indexing bug (i -> j).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/03/26 - tsheyar: compiler/algebra/opt/opt_general.brg,1.50
-- Fixed bug in brg-based optimization.
(Added missing state-label assignments for new logical operators.)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/03/26 - tsheyar: compiler/algebra/prop/prop_key.c,1.43
-- Use the correct boolean test to check for guide nodes.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/03/26 - tsheyar: compiler/algebra/logical.c,1.87
compiler/algebra/physical.c,1.63 compiler/algebra/prop/prop_ocol.c,1.54
-- Prepare {ancestor-or-|descendant-or-|}self steps in the algebra
for attribute context nodes.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/03/26 - tsheyar: compiler/algebra/load_stats.c,1.14
compiler/algebra/prop/prop_guide.c,1.26
compiler/include/load_stats.h,1.6
-- Extended guide loading to cope with QNames (instead of strings).
-- Cleaned up and simplified guide property inference.
-- Extended guide property inference. (QName support; Steps evaluated
on the guide without result nodes now get an empty guide mapping
---instead of no mapping.)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/03/26 - tsheyar: compiler/algebra/opt/opt_general.brg,1.51
-- Fix last check-in.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/03/27 - tsheyar: compiler/algebra/prop/prop_key.c,1.44
-- 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_ocol.c
Index: prop_ocol.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_ocol.c,v
retrieving revision 1.46.2.4
retrieving revision 1.46.2.5
diff -u -d -r1.46.2.4 -r1.46.2.5
--- prop_ocol.c 21 Mar 2008 13:32:01 -0000 1.46.2.4
+++ prop_ocol.c 27 Mar 2008 11:20:31 -0000 1.46.2.5
@@ -716,6 +716,9 @@
"wrong item type '0x%X' in the input of a path step",
PFprop_type_of (R(n), n->sem.step.item));
#endif
+ {
+ PFalg_simple_type_t ty;
+
new_ocols (n, 2);
ocol_at (n, 0)
@@ -725,14 +728,18 @@
n->sem.step.iter) };
if (n->sem.step.spec.axis == alg_attr)
- ocol_at (n, 1)
- = (PFalg_schm_item_t) { .name = n->sem.step.item_res,
- .type = aat_anode };
+ ty = aat_anode;
+ else if (n->sem.step.spec.axis == alg_anc_s)
+ ty = PFprop_type_of (R(n), n->sem.step.item) | aat_pnode;
+ else if (n->sem.step.spec.axis == alg_desc_s ||
+ n->sem.step.spec.axis == alg_self)
+ ty = PFprop_type_of (R(n), n->sem.step.item);
else
- ocol_at (n, 1)
- = (PFalg_schm_item_t) { .name = n->sem.step.item_res,
- .type = aat_pnode };
- break;
+ ty = aat_pnode;
+
+ ocol_at (n, 1) = (PFalg_schm_item_t) { .name =
n->sem.step.item_res,
+ .type = ty };
+ } break;
case la_step_join:
case la_guide_step_join:
@@ -751,17 +758,25 @@
"wrong item type '0x%X' in the input of a path step",
PFprop_type_of (R(n), n->sem.step.item));
#endif
+ {
+ PFalg_simple_type_t ty;
+
ocols (n) = copy_ocols (ocols (R(n)), ocols_count (R(n)) + 1);
if (n->sem.step.spec.axis == alg_attr)
- ocol_at (n, ocols_count (n))
- = (PFalg_schm_item_t) { .name = n->sem.step.item_res,
- .type = aat_anode };
+ ty = aat_anode;
+ else if (n->sem.step.spec.axis == alg_anc_s)
+ ty = PFprop_type_of (R(n), n->sem.step.item) | aat_pnode;
+ else if (n->sem.step.spec.axis == alg_desc_s ||
+ n->sem.step.spec.axis == alg_self)
+ ty = PFprop_type_of (R(n), n->sem.step.item);
else
- ocol_at (n, ocols_count (n))
- = (PFalg_schm_item_t) { .name = n->sem.step.item_res,
- .type = aat_pnode };
+ ty = aat_pnode;
+
+ ocol_at (n, ocols_count (n))
+ = (PFalg_schm_item_t) { .name = n->sem.step.item_res,
+ .type = ty };
ocols_count (n)++;
- break;
+ } break;
case la_doc_index_join:
#ifndef NDEBUG
U prop_key.c
Index: prop_key.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_key.c,v
retrieving revision 1.37.4.3
retrieving revision 1.37.4.4
diff -u -d -r1.37.4.3 -r1.37.4.4
--- prop_key.c 21 Mar 2008 13:32:00 -0000 1.37.4.3
+++ prop_key.c 27 Mar 2008 11:20:28 -0000 1.37.4.4
@@ -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) &&
@@ -572,7 +585,7 @@
PFprop_level_right (n->prop, n->sem.step.item) >= 0 &&
(n->sem.step.spec.axis == alg_desc ||
n->sem.step.spec.axis == alg_desc_s) &&
- PFprop_guide_count (R(n)->prop, n->sem.step.item) &&
+ PFprop_guide (R(n)->prop, n->sem.step.item) &&
find_guide_max_rec (
n->sem.step.guide_count,
n->sem.step.guides,
U prop_guide.c
Index: prop_guide.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_guide.c,v
retrieving revision 1.19.4.4
retrieving revision 1.19.4.5
diff -u -d -r1.19.4.4 -r1.19.4.5
--- prop_guide.c 21 Mar 2008 13:32:00 -0000 1.19.4.4
+++ prop_guide.c 27 Mar 2008 11:20:24 -0000 1.19.4.5
@@ -29,7 +29,6 @@
* $Id$
*/
-
#include "pathfinder.h"
#include <assert.h>
#include <string.h>
@@ -48,875 +47,688 @@
/* guide_mapping_list of n */
#define MAPPING_LIST(n) ((n)->prop->guide_mapping_list)
[...1655 lines suppressed...]
+ ret = (PFguide_tree_t **) PFmalloc (count * sizeof (PFguide_tree_t *));
- for(unsigned int i = 0; i < count; i++) {
- ret[i] = *((PFguide_tree_t**)PFarray_at(guide_list, i));
+ index = mapping->first_guide;
+ i = 0;
+
+ /* return the guides in guide id order */
+ while (index >= 0) {
+ assert (index < (int) PFarray_last (mapping->guide_order));
+ ret[i++] = GUIDE_AT(mapping->guide_list, index);
+ index = GUIDE_IDX_AT(mapping->guide_order, index);
}
return ret;
}
/* vim:set shiftwidth=4 expandtab filetype=c: */
-
-
-------------------------------------------------------------------------
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