Update of /cvsroot/monetdb/pathfinder/compiler/algebra/opt
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6069/compiler/algebra/opt

Modified Files:
      Tag: M5XQ
        opt_algebra_cse.c opt_thetajoin.c 
Log Message:

re-aligned with development trunk:
files
compiler/algebra/opt/opt_algebra_cse.c
compiler/algebra/opt/opt_thetajoin.c
compiler/sql/lalg2sql.brg
appeared to differ in the M5XQ branch from the development trunk
although they have not been modified in the M5XQ branch;
most probably some propagation of changes from the development
trunk to the M5XQ branch went wrong unnoticedly ...


Index: opt_algebra_cse.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_algebra_cse.c,v
retrieving revision 1.50.2.2
retrieving revision 1.50.2.3
diff -u -d -r1.50.2.2 -r1.50.2.3
--- opt_algebra_cse.c   15 Jun 2009 12:44:40 -0000      1.50.2.2
+++ opt_algebra_cse.c   20 Jun 2009 10:17:23 -0000      1.50.2.3
@@ -996,8 +996,8 @@
                  for (j = 0; j < b->sem.aggr.count; j++) {
                      if ((IS_NULL (a->sem.aggr.aggr[i].col)
                           ? col_NULL
-                          : ACTCOL (L(a), a->sem.aggr.aggr[i].col) ==
-                          IS_NULL (b->sem.aggr.aggr[j].col)
+                          : ACTCOL (L(a), a->sem.aggr.aggr[i].col)) ==
+                         (IS_NULL (b->sem.aggr.aggr[j].col)
                           ? col_NULL
                           : ACTCOL (L(b), b->sem.aggr.aggr[j].col)) &&
                          (a->sem.aggr.aggr[i].kind ==

Index: opt_thetajoin.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_thetajoin.c,v
retrieving revision 1.40.2.4
retrieving revision 1.40.2.5
diff -u -d -r1.40.2.4 -r1.40.2.5
--- opt_thetajoin.c     15 Jun 2009 12:45:31 -0000      1.40.2.4
+++ opt_thetajoin.c     20 Jun 2009 10:17:23 -0000      1.40.2.5
@@ -1265,14 +1265,28 @@
             break;
 
         case la_rowrank:
-            /* the following rewrite is incorrect as the thetajoin arguments
-               filter out some rows from the cross product -- Not every
-               iteration has the same number of rows anymore and thus row-
-               ranking needs to take the result of the thetajoin into account. 
*/
-            break;
-#if 0
+            if (is_tj (L(p))) {
+                /******************** thetajoin check ************************/
+
+                unsigned int count = 0;
+                PFarray_t   *pred = p->sem.thetajoin_opt.pred;
+                
+                /* The following rewrite is incorrect if we have a real
+                   thetajoin as the thetajoin arguments filter out some
+                   rows from the cross product -- Not every group exists
+                   anymore and thus row-ranking needs to take the result
+                   of the thetajoin into account. */
+
+                /* Check if we have a cross product without selection. */
+                for (i = 0; i < PFarray_last (pred); i++)
+                    if (PERS_AT(pred, i)) count++;
+                /* skip rewrite (see explanation above) */
+                if (count) break;
+
+                /******************** thetajoin check ************************/
+            }
             /* fall through */
-#endif
+
         case la_rank:
             /* An expression that does not contain any sorting column
                required by the rank operator is independent of the rank.


------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to