Update of /cvsroot/monetdb/pathfinder/compiler/algebra/opt
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23019/algebra/opt
Modified Files:
opt_set.c
Log Message:
-- Rewrite scjoin operators into duplicate generating ones as intermediate
step. (This helps the join pushdown phase to push down more joins.)
Index: opt_set.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_set.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- opt_set.c 13 Nov 2006 17:10:59 -0000 1.1
+++ opt_set.c 17 Nov 2006 14:03:41 -0000 1.2
@@ -50,6 +50,11 @@
#define L(p) ((p)->child[0])
/** starting from p, make a step right */
#define R(p) ((p)->child[1])
+/** and so on ... */
+#define LL(p) (L(L(p)))
+#define LR(p) (R(L(p)))
+#define RL(p) (L(R(p)))
+#define RR(p) (R(R(p)))
#define SEEN(p) ((p)->bit_dag)
@@ -71,6 +76,56 @@
/* action code */
switch (p->kind) {
+ case la_eqjoin:
+ /* Rewrite scjoin into duplicate generating scjoins
+ (underneath join operators). This hopefully allows
+ the above join to be pushed down in a later phase. */
+ if (PFprop_set (p->prop) &&
+ L(p)->kind == la_scjoin &&
+ PFprop_set (L(p)->prop)) {
+ PFalg_att_t item_res;
+ item_res = PFalg_ori_name (
+ PFalg_unq_name (att_item, 0),
+ ~(L(p)->sem.scjoin.item |
+ L(p)->sem.scjoin.iter));
+ *L(p) = *PFla_project (
+ PFla_dup_scjoin (
+ LL(p),
+ LR(p),
+ L(p)->sem.scjoin.axis,
+ L(p)->sem.scjoin.ty,
+ L(p)->sem.scjoin.item,
+ item_res),
+ PFalg_proj (L(p)->sem.scjoin.iter,
+ L(p)->sem.scjoin.iter),
+ PFalg_proj (L(p)->sem.scjoin.item,
+ item_res));
+ break;
+ }
+ if (PFprop_set (p->prop) &&
+ R(p)->kind == la_scjoin &&
+ PFprop_set (R(p)->prop)) {
+ PFalg_att_t item_res;
+ item_res = PFalg_ori_name (
+ PFalg_unq_name (att_item, 0),
+ ~(R(p)->sem.scjoin.item |
+ R(p)->sem.scjoin.iter));
+ *R(p) = *PFla_project (
+ PFla_dup_scjoin (
+ RL(p),
+ RR(p),
+ R(p)->sem.scjoin.axis,
+ R(p)->sem.scjoin.ty,
+ R(p)->sem.scjoin.item,
+ item_res),
+ PFalg_proj (R(p)->sem.scjoin.iter,
+ R(p)->sem.scjoin.iter),
+ PFalg_proj (R(p)->sem.scjoin.item,
+ item_res));
+ break;
+ }
+ break;
+
case la_distinct:
if (PFprop_set (p->prop))
*p = *PFla_dummy (L(p));
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-pf-checkins mailing list
Monetdb-pf-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins