Update of /cvsroot/monetdb/pathfinder/compiler/algebra
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv5047/compiler/algebra
Modified Files:
Tag: M5XQ
physical.c
Log Message:
propagated changes of Wednesday May 20 2009
from the development trunk to the M5XQ branch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/05/20 - tsheyar: compiler/algebra/physical.c,1.93
-- Renamed algebra/intro_rec_border.c into algebra/intro_borders.c.
-- Renamed include/intro_rec_border.h into include/intro_borders.h.
-- Extended the physical algebra with a dependent cross product operator
that only evaluates its right side if the left side produces at least
one row.
This change implicitely implements a control structure for some conditionals.
E.g., the following query conditionally evaluates the independent
expressions ('doc("xmark-sf0.001.xml")//*' and 'doc("xmark-sf100.xml")//*'):
if (1 = (1,2,3))
then doc("xmark-sf0.1.xml")//*
else doc("xmark-sf100.xml")//*
With the dependent cross product operator in place this leads to the
evaluation
of the (previously independent) then-branch and the avoidance of the
evaluation
of the (expensive) else-branch.
-- Adjusted stable output.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
U physical.c
Index: physical.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/physical.c,v
retrieving revision 1.89.2.2
retrieving revision 1.89.2.3
diff -u -d -r1.89.2.2 -r1.89.2.3
--- physical.c 7 May 2009 14:59:38 -0000 1.89.2.2
+++ physical.c 20 May 2009 16:28:19 -0000 1.89.2.3
@@ -519,6 +519,36 @@
}
/**
+ * Cross product (Cartesian product) of two relations
+ * where the second argument is only evaluated if the first argument
+ * produces at least one tuple.
+ */
+PFpa_op_t *
+PFpa_dep_cross (const PFpa_op_t *n1, const PFpa_op_t *n2)
+{
+ /* the operator behaves like a cross product */
+ PFpa_op_t *ret = PFpa_cross (n1, n2);
+ ret->kind = pa_dep_cross;
+ ret->cost -= 2 * JOIN_COST;
+
+ return ret;
+}
+
+/**
+ * Border for dependent operator describing which operators
+ * lie in-/outside.
+ */
+PFpa_op_t *
+PFpa_dep_border (const PFpa_op_t *n)
+{
+ /* the operator behaves like a recursion border */
+ PFpa_op_t *ret = PFpa_rec_border (n);
+ ret->kind = pa_dep_border;
+
+ return ret;
+}
+
+/**
* LeftJoin: Equi-Join of two relations. Preserves the ordering
* of the left operand.
*/
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins