Update of /cvsroot/monetdb/pathfinder/compiler/debug
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv11514/debug

Modified Files:
        logdebug.c physdebug.c 
Log Message:
-- Replaced aggregate operators count, min, max, avg, sum, prod, seqty1,
   and all in the algebra by a single aggregate operator ``aggr'' 
   that can handle multiple aggregates. The aggregate entries 
   are of kind count, min, max, avg, sum, prod, seqty1, all, and dist. 

-- Added new aggregate kind ``dist'' that allows to represent group by
   columns that functionally depend on the partitioning criterion
   in the result of the grouping aggregate.

-- Added rewrite that merges aggregates.                                        
                                             
                                                                                
                                             
-- Added rewrite that removes superfluous aggregates.                           
                                             
                                                                                
                                             
-- Added rewrite that pushes a rank operator through an aggregate.              
                                             
                                                                                
                                             
-- Extended the XML import to cope with the old                                 
                                             
   as well as the new representation of aggregates.                             
                                             


U logdebug.c
Index: logdebug.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/debug/logdebug.c,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -d -r1.129 -r1.130
--- logdebug.c  12 May 2009 14:26:53 -0000      1.129
+++ logdebug.c  12 Jun 2009 13:06:14 -0000      1.130
@@ -80,12 +80,7 @@
     , [la_bool_or ]         = "OR"
     , [la_bool_not]         = "NOT"
     , [la_to]               = "op:to"
-    , [la_avg]              = "AVG"
-    , [la_max]              = "MAX"
-    , [la_min]              = "MIN"
-    , [la_sum]              = "SUM"
-    , [la_prod]             = "PROD"
-    , [la_count]            = "COUNT"
+    , [la_aggr]             = "AGGR"
     , [la_rownum]           = "ROWNUM"
     , [la_rowrank]          = "ROWRANK"
     , [la_rank]             = "RANK"
@@ -93,8 +88,6 @@
     , [la_type]             = "TYPE"
     , [la_type_assert]      = "type assertion"
     , [la_cast]             = "CAST"
-    , [la_seqty1]           = "SEQTY1"
-    , [la_all]              = "ALL"
     , [la_step]             = "/|"
     , [la_step_join]        = "/|+"
     , [la_guide_step]       = "/| (guide)"
@@ -164,12 +157,7 @@
     , [la_bool_or ]         = "or"
     , [la_bool_not]         = "not"
     , [la_to]               = "op:to"
-    , [la_avg]              = "avg"
-    , [la_max]              = "max"
-    , [la_min]              = "min"
-    , [la_sum]              = "sum"
-    , [la_prod]             = "prod"
-    , [la_count]            = "count"
+    , [la_aggr]             = "aggr"
     , [la_rownum]           = "rownum"
     , [la_rowrank]          = "rowrank"
     , [la_rank]             = "rank"
@@ -177,8 +165,6 @@
     , [la_type]             = "type"
     , [la_type_assert]      = "type assertion"
     , [la_cast]             = "cast"
-    , [la_seqty1]           = "seqty1"
-    , [la_all]              = "all"
     , [la_step]             = "XPath step"
     , [la_step_join]        = "path step join"
     , [la_guide_step]       = "XPath step (with guide information)"
@@ -424,12 +410,7 @@
         , [la_bool_or ]        = "#C0C0C0"
         , [la_bool_not]        = "#C0C0C0"
         , [la_to]              = "#C0C0C0"
-        , [la_avg]             = "#A0A0A0"
-        , [la_max]             = "#A0A0A0"
-        , [la_min]             = "#A0A0A0"
-        , [la_sum]             = "#A0A0A0"
-        , [la_prod]            = "#A0A0A0"
-        , [la_count]           = "#A0A0A0"
+        , [la_aggr]            = "#A0A0A0"
         , [la_rownum]          = "#FF0000"
         , [la_rowrank]         = "#FF0000"
         , [la_rank]            = "#FF3333"
@@ -437,8 +418,6 @@
         , [la_type]            = "#C0C0C0"
         , [la_type_assert]     = "#C0C0C0"
         , [la_cast]            = "#C0C0C0"
-        , [la_seqty1]          = "#C0C0C0"
-        , [la_all]             = "#C0C0C0"
         , [la_step]            = "#1E90FF"
         , [la_step_join]       = "#1E9099"
         , [la_guide_step]      = "#007AE0"
@@ -729,32 +708,21 @@
                             PFcol_str (n->sem.unary.col));
             break;
 
-        case la_avg:
-        case la_max:
-        case la_min:
-        case la_sum:
-        case la_prod:
-        case la_seqty1:
-        case la_all:
-            if (n->sem.aggr.part == col_NULL)
-                PFarray_printf (DOT, "%s (%s:<%s>)", a_id[n->kind],
-                                PFcol_str (n->sem.aggr.res),
-                                PFcol_str (n->sem.aggr.col));
-            else
-                PFarray_printf (DOT, "%s (%s:<%s>/%s)", a_id[n->kind],
-                                PFcol_str (n->sem.aggr.res),
-                                PFcol_str (n->sem.aggr.col),
-                                PFcol_str (n->sem.aggr.part));
-            break;
+        case la_aggr:
+            /* overwrite standard node layout */
+            PFarray_printf (DOT, "\", shape=polygon peripheries=2, label=\"");
 
-        case la_count:
-            if (n->sem.aggr.part == col_NULL)
-                PFarray_printf (DOT, "%s (%s)", a_id[n->kind],
-                                PFcol_str (n->sem.aggr.res));
-            else
-                PFarray_printf (DOT, "%s (%s:/%s)", a_id[n->kind],
-                                PFcol_str (n->sem.aggr.res),
+            PFarray_printf (DOT, "%s", a_id[n->kind]);
+            if (n->sem.aggr.part != col_NULL)
+                PFarray_printf (DOT, " / %s",
                                 PFcol_str (n->sem.aggr.part));
+
+            for (c = 0; c < n->sem.aggr.count; c++)
+                PFarray_printf (DOT, "\\n%s = %s (%s)",
+                                PFcol_str (n->sem.aggr.aggr[c].res),
+                                PFalg_aggr_kind_str (n->sem.aggr.aggr[c].kind),
+                                n->sem.aggr.aggr[c].col
+                                ? PFcol_str (n->sem.aggr.aggr[c].col) : "");
             break;
 
         case la_rownum:
@@ -2028,39 +1996,26 @@
                             PFcol_str (n->sem.unary.col));
             break;
 
-        case la_avg:
-        case la_max:
-        case la_min:
-        case la_sum:
-        case la_prod:
-        case la_seqty1:
-        case la_all:
-            PFarray_printf (xml,
-                            "    <content>\n"
-                            "      <column name=\"%s\" new=\"true\"/>\n"
-                            "      <column name=\"%s\" new=\"false\""
-                                         " function=\"item\"/>\n",
-                            PFcol_str (n->sem.aggr.res),
-                            PFcol_str (n->sem.aggr.col));
+        case la_aggr:
+            PFarray_printf (xml, "    <content>\n");
             if (n->sem.aggr.part != col_NULL)
                 PFarray_printf (xml,
                             "      <column name=\"%s\" function=\"partition\""
                                     " new=\"false\"/>\n",
                             PFcol_str (n->sem.aggr.part));
-            PFarray_printf (xml, "    </content>\n");
-
-            break;
-
-        case la_count:
-            PFarray_printf (xml,
-                            "    <content>\n"
-                            "      <column name=\"%s\" new=\"true\"/>\n",
-                            PFcol_str (n->sem.aggr.res));
-            if (n->sem.aggr.part != col_NULL)
+            for (c = 0; c < n->sem.aggr.count; c++) {
                 PFarray_printf (xml,
-                            "      <column name=\"%s\" function=\"partition\""
-                                    " new=\"false\"/>\n",
-                            PFcol_str (n->sem.aggr.part));
+                                "      <aggregate kind=\"%s\">\n"
+                                "        <column name=\"%s\" new=\"true\"/>\n",
+                                PFalg_aggr_kind_str (n->sem.aggr.aggr[c].kind),
+                                PFcol_str (n->sem.aggr.aggr[c].res));
+                if (n->sem.aggr.aggr[c].col)
+                    PFarray_printf (xml,
+                                    "        <column name=\"%s\" new=\"false\""
+                                                   " function=\"item\"/>\n",
+                                    PFcol_str (n->sem.aggr.aggr[c].col));
+                PFarray_printf (xml, "      </aggregate>\n");
+            }
             PFarray_printf (xml, "    </content>\n");
             break;
 

U physdebug.c
Index: physdebug.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/debug/physdebug.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- physdebug.c 20 May 2009 16:00:45 -0000      1.78
+++ physdebug.c 12 Jun 2009 13:06:15 -0000      1.79
@@ -90,21 +90,14 @@
     , [pa_bool_or]         = "OR"
     , [pa_bool_not]        = "NOT"
     , [pa_to]              = "op:to"
-    , [pa_avg]             = "AVG"
-    , [pa_min]             = "MAX"
-    , [pa_max]             = "MIN"
-    , [pa_sum]             = "SUM"
-    , [pa_prod]            = "PRODUCT"
+    , [pa_aggr]            = "AGGR"
     , [pa_count_ext]       = "{COUNT}"
-    , [pa_count]           = "COUNT"
     , [pa_mark]            = "mark"
     , [pa_rank]            = "rank"
     , [pa_mark_grp]        = "mark_grp"
     , [pa_type]            = "TYPE"
     , [pa_type_assert]     = "type assertion"
     , [pa_cast]            = "CAST"
-    , [pa_seqty1]          = "SEQTY1"
-    , [pa_all]             = "ALL"
     , [pa_llscjoin]        = "//|"
     , [pa_llscjoin_dup]    = "//|+"
     , [pa_doc_tbl]         = "DOC"
@@ -241,21 +234,14 @@
         , [pa_bool_and]        = "\"#C0C0C0\""
         , [pa_bool_or]         = "\"#C0C0C0\""
         , [pa_to]              = "\"#C0C0C0\""
-        , [pa_avg]             = "\"#A0A0A0\""
-        , [pa_max]             = "\"#A0A0A0\""
-        , [pa_min]             = "\"#A0A0A0\""
-        , [pa_sum]             = "\"#A0A0A0\""
-        , [pa_prod]            = "\"#A0A0A0\""
+        , [pa_aggr]            = "\"#A0A0A0\""
         , [pa_count_ext]       = "\"#A0A0A0\""
-        , [pa_count]           = "\"#A0A0A0\""
         , [pa_mark]            = "\"#FFBBBB\""
         , [pa_rank]            = "\"#FFBBBB\""
         , [pa_mark_grp]        = "\"#FFBBBB\""
         , [pa_type]            = "\"#C0C0C0\""
         , [pa_type_assert]     = "\"#C0C0C0\""
         , [pa_cast]            = "\"#C0C0C0\""
-        , [pa_seqty1]          = "\"#A0A0A0\""
-        , [pa_all]             = "\"#A0A0A0\""
         , [pa_llscjoin]        = "\"#1E90FF\""
         , [pa_llscjoin_dup]    = "\"#1E9099\""
         , [pa_doc_tbl]         = "\"#C0C0C0\""
@@ -466,7 +452,6 @@
             break;
 
         case pa_count_ext:
-        case pa_count:
             if (n->sem.count.part == col_NULL)
                 PFarray_printf (dot, "%s (%s)", a_id[n->kind],
                                 PFcol_str (n->sem.count.res));
@@ -479,22 +464,21 @@
                                 PFcol_str (n->sem.count.loop));
             break;
 
-        case pa_avg:
-        case pa_max:
-        case pa_min:
-        case pa_sum:
-        case pa_prod:
-        case pa_seqty1:
-        case pa_all:
-            if (n->sem.aggr.part == col_NULL)
-                PFarray_printf (dot, "%s (%s:<%s>)", a_id[n->kind],
-                                PFcol_str (n->sem.aggr.res),
-                                PFcol_str (n->sem.aggr.col));
-            else
-                PFarray_printf (dot, "%s (%s:<%s>/%s)", a_id[n->kind],
-                                PFcol_str (n->sem.aggr.res),
-                                PFcol_str (n->sem.aggr.col),
+        case pa_aggr:
+            /* overwrite standard node layout */
+            PFarray_printf (dot, "\", shape=polygon peripheries=2, label=\"");
+
+            PFarray_printf (dot, "%s", a_id[n->kind]);
+            if (n->sem.aggr.part != col_NULL)
+                PFarray_printf (dot, " / %s",
                                 PFcol_str (n->sem.aggr.part));
+
+            for (c = 0; c < n->sem.aggr.count; c++)
+                PFarray_printf (dot, "\\n%s = %s (%s)",
+                                PFcol_str (n->sem.aggr.aggr[c].res),
+                                PFalg_aggr_kind_str (n->sem.aggr.aggr[c].kind),
+                                n->sem.aggr.aggr[c].col
+                                ? PFcol_str (n->sem.aggr.aggr[c].col) : "");
             break;
 
         case pa_mark:


------------------------------------------------------------------------------
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

Reply via email to