Update of /cvsroot/monetdb/pathfinder/compiler/algebra
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv28729/compiler/algebra
Modified Files:
Tag: Aug2009_NFI
algebra_cse.c builtins.c logical.c physical.c planner.c
Log Message:
enable heuristic rewrite value-selections in the algebra backend of
MonetDB/xQuery
has to properly implement pf:attribute(ctx, node, ns1, loc1, ns2, loc2) first,
as only the verion without namespaces was there (that one is now gone).
many restrictions:
- only non-loop-lifted equality tests
- not involving fn:collection or pf:collection (as path reversal in the latter
will never find the supernode)
- not involving any date/time/etc typed expressions (as the indices only work
for string and numerical equality)
went through the testweb and fixed all apparant problems
note the Aug2009_NFI value indices are full; whereas previously they would omit
frequent data items
U physical.c
Index: physical.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/physical.c,v
retrieving revision 1.94.6.1
retrieving revision 1.94.6.2
diff -u -d -r1.94.6.1 -r1.94.6.2
--- physical.c 28 Sep 2009 23:20:25 -0000 1.94.6.1
+++ physical.c 6 Oct 2009 17:22:48 -0000 1.94.6.2
@@ -4021,7 +4021,11 @@
PFalg_col_t item,
PFalg_col_t item_doc,
PFalg_col_t item_res,
- bool id)
+ bool id,
+ const char* ns1,
+ const char* loc1,
+ const char* ns2,
+ const char* loc2)
{
PFpa_op_t *ret = wire1 (pa_vx_lookup, n);
@@ -4030,6 +4034,10 @@
ret->sem.vx_lookup.item = item;
ret->sem.vx_lookup.item_doc = item_doc;
ret->sem.vx_lookup.item_res = item_res;
+ ret->sem.vx_lookup.ns1 = ns1;
+ ret->sem.vx_lookup.loc1 = loc1;
+ ret->sem.vx_lookup.ns2 = ns2;
+ ret->sem.vx_lookup.loc2 = loc2;
/* allocate memory for the result schema */
ret->schema.count = 2;
U algebra_cse.c
Index: algebra_cse.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/algebra_cse.c,v
retrieving revision 1.85.6.1
retrieving revision 1.85.6.2
diff -u -d -r1.85.6.1 -r1.85.6.2
--- algebra_cse.c 28 Sep 2009 23:20:25 -0000 1.85.6.1
+++ algebra_cse.c 6 Oct 2009 17:22:47 -0000 1.85.6.2
@@ -450,7 +450,11 @@
return (a->sem.doc_join.kind == b->sem.doc_join.kind
&& a->sem.doc_join.item == b->sem.doc_join.item
&& a->sem.doc_join.item_res == b->sem.doc_join.item_res
- && a->sem.doc_join.item_doc == b->sem.doc_join.item_doc);
+ && a->sem.doc_join.item_doc == b->sem.doc_join.item_doc
+ && strcmp(a->sem.doc_join.ns1, b->sem.doc_join.ns1) == 0
+ && strcmp(a->sem.doc_join.loc1, b->sem.doc_join.loc1) == 0
+ && strcmp(a->sem.doc_join.ns2, b->sem.doc_join.ns2) == 0
+ && strcmp(a->sem.doc_join.loc2, b->sem.doc_join.loc2) ==
0);
break;
case la_doc_access:
U planner.c
Index: planner.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/planner.c,v
retrieving revision 1.86.2.1.2.1
retrieving revision 1.86.2.1.2.2
diff -u -d -r1.86.2.1.2.1 -r1.86.2.1.2.2
--- planner.c 28 Sep 2009 23:20:25 -0000 1.86.2.1.2.1
+++ planner.c 6 Oct 2009 17:22:49 -0000 1.86.2.1.2.2
@@ -3124,6 +3124,10 @@
item_doc = n->sem.doc_join.item_doc,
iter,
iter2;
+ const char *ns1 = n->sem.doc_join.ns1,
+ *loc1 = n->sem.doc_join.loc1,
+ *ns2 = n->sem.doc_join.ns2,
+ *loc2 = n->sem.doc_join.loc2;
unsigned int count = n->schema.count + 1,
count_in = 2;
PFalg_proj_t *proj = PFmalloc (count * sizeof (PFalg_proj_t)),
@@ -3166,7 +3170,8 @@
item,
item_doc,
item_res,
- n->sem.doc_join.kind == la_dj_text),
+ n->sem.doc_join.kind == la_dj_text,
+ ns1, loc1, ns2, loc2),
count_in,
proj_in)),
count,
U logical.c
Index: logical.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/logical.c,v
retrieving revision 1.126.6.1
retrieving revision 1.126.6.2
diff -u -d -r1.126.6.1 -r1.126.6.2
--- logical.c 28 Sep 2009 23:20:25 -0000 1.126.6.1
+++ logical.c 6 Oct 2009 17:22:48 -0000 1.126.6.2
@@ -2978,7 +2978,8 @@
PFla_doc_index_join (const PFla_op_t *doc, const PFla_op_t *n,
PFla_doc_join_kind_t kind,
PFalg_col_t item,
- PFalg_col_t item_res, PFalg_col_t item_doc)
+ PFalg_col_t item_res, PFalg_col_t item_doc,
+ const char* ns1, const char* loc1, const char* ns2, const
char* loc2)
{
PFla_op_t *ret;
unsigned int i;
@@ -2993,6 +2994,10 @@
ret->sem.doc_join.item = item;
ret->sem.doc_join.item_res = item_res;
ret->sem.doc_join.item_doc = item_doc;
+ ret->sem.doc_join.ns1 = ns1;
+ ret->sem.doc_join.loc1 = loc1;
+ ret->sem.doc_join.ns2 = ns2;
+ ret->sem.doc_join.loc2 = loc2;
#ifndef NDEBUG
if (PFprop_ocol (n, item_res))
@@ -4396,7 +4401,11 @@
n->sem.doc_join.kind,
n->sem.doc_join.item,
n->sem.doc_join.item_res,
- n->sem.doc_join.item_doc);
+ n->sem.doc_join.item_doc,
+ n->sem.doc_join.ns1,
+ n->sem.doc_join.loc1,
+ n->sem.doc_join.ns2,
+ n->sem.doc_join.loc2);
case la_doc_tbl:
return PFla_doc_tbl (left,
U builtins.c
Index: builtins.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/builtins.c,v
retrieving revision 1.126.2.1.2.1
retrieving revision 1.126.2.1.2.2
diff -u -d -r1.126.2.1.2.1 -r1.126.2.1.2.2
--- builtins.c 28 Sep 2009 23:20:25 -0000 1.126.2.1.2.1
+++ builtins.c 6 Oct 2009 17:22:48 -0000 1.126.2.1.2.2
@@ -5552,7 +5552,7 @@
op = project (
doc_index_join (doc, in,
id ? la_dj_id : la_dj_idref,
- col_item, col_res, col_item1),
+ col_item, col_res, col_item1, "*", "*", "*", "*"),
proj (col_iter, col_iter),
proj (col_item, col_res));
@@ -6742,15 +6742,19 @@
eqjoin (project (args[0].rel,
proj (col_iter, col_iter),
proj (col_item, col_item)),
- project (args[1].rel,
+ project (args[5].rel,
proj (col_iter1, col_iter),
proj (col_item1, col_item)),
col_iter,
- col_iter1),
+ col_iter1),
la_dj_attr,
col_item1,
col_res,
- col_item),
+ col_item,
+ ((struct PFla_op_t*)
args[1].rel)->sem.attach.value.val.str,
+ ((struct PFla_op_t*)
args[2].rel)->sem.attach.value.val.str,
+ ((struct PFla_op_t*)
args[3].rel)->sem.attach.value.val.str,
+ ((struct PFla_op_t*)
args[4].rel)->sem.attach.value.val.str),
proj (col_iter, col_iter),
proj (col_item, col_res))),
col_pos,
@@ -6786,7 +6790,7 @@
la_dj_text,
col_item1,
col_res,
- col_item),
+ col_item, "*", "*", "*", "*"),
proj (col_iter, col_iter),
proj (col_item, col_res))),
col_pos,
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins