Update of /cvsroot/monetdb/pathfinder/compiler/debug
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6600/debug

Modified Files:
        logdebug.c 
Log Message:
-- Introduced a new column-name-origin property that enhances the column names
   in the DOT generated algebra plans. If a column stems from a ref_tbl or a
   path step we now keep the original name throughout the plan.
   (Use pf-option -fN to print the mapping of original names.)

-- Make property usage a little bit more defensive. Instead of !PFprop_icol
   a new function PFprop_not_icol is introduced that copes correctly with
   missing property information.


Index: logdebug.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/debug/logdebug.c,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -d -r1.134 -r1.135
--- logdebug.c  7 Jan 2010 15:24:27 -0000       1.134
+++ logdebug.c  17 Mar 2010 21:56:29 -0000      1.135
@@ -625,25 +625,43 @@
             break;
 
         case la_project:
-            if (n->sem.proj.items[0].new != n->sem.proj.items[0].old)
-                PFarray_printf (DOT, "%s (%s:%s", a_id[n->kind],
-                                PFcol_str (n->sem.proj.items[0].new),
-                                PFcol_str (n->sem.proj.items[0].old));
-            else
-                PFarray_printf (DOT, "%s (%s", a_id[n->kind],
-                                PFcol_str (n->sem.proj.items[0].old));
-
-            for (c = 1; c < n->sem.proj.count; c++)
-                if (n->sem.proj.items[c].new != n->sem.proj.items[c].old)
-                    PFarray_printf (DOT, ", %s:%s",
-                                    PFcol_str (n->sem.proj.items[c].new),
-                                    PFcol_str (n->sem.proj.items[c].old));
+            {
+                int startpos = PFarray_last (DOT),
+                    curpos;
+                char *sep,
+                     *space    = ", ",
+                     *newline  = ",\\n";
+                /* print first column */
+                if (n->sem.proj.items[0].new != n->sem.proj.items[0].old)
+                    PFarray_printf (DOT, "%s (%s:%s", a_id[n->kind],
+                                    PFcol_str (n->sem.proj.items[0].new),
+                                    PFcol_str (n->sem.proj.items[0].old));
                 else
-                    PFarray_printf (DOT, ", %s",
-                                    PFcol_str (n->sem.proj.items[c].old));
+                    PFarray_printf (DOT, "%s (%s", a_id[n->kind],
+                                    PFcol_str (n->sem.proj.items[0].old));
 
-            PFarray_printf (DOT, ")");
-            break;
+                for (c = 1; c < n->sem.proj.count; c++) {
+                    curpos = PFarray_last (DOT);
+                    if (curpos - startpos > 42) {
+                        sep = newline;
+                        startpos = curpos;
+                    }
+                    else
+                        sep = space;
+
+                    if (n->sem.proj.items[c].new != n->sem.proj.items[c].old)
+                        PFarray_printf (DOT, "%s%s:%s",
+                                        sep,
+                                        PFcol_str (n->sem.proj.items[c].new),
+                                        PFcol_str (n->sem.proj.items[c].old));
+                    else
+                        PFarray_printf (DOT, "%s%s",
+                                        sep,
+                                        PFcol_str (n->sem.proj.items[c].old));
+                }
+
+                PFarray_printf (DOT, ")");
+            } break;
 
         case la_select:
             PFarray_printf (DOT, "%s (%s)", a_id[n->kind],
@@ -1072,6 +1090,38 @@
             fmt = prop_args;
 
         while (*fmt) {
+            if (*fmt == '+' || *fmt == 'N') {
+                bool  started  = false;
+                int   startpos = PFarray_last (DOT),
+                      curpos;
+                char *sep,
+                     *space    = ", ",
+                     *newline  = ",\\n";
+                /* list columns marked const */
+                for (unsigned int i = 0; i < n->schema.count; i++) {
+                    PFalg_col_t col  = n->schema.items[i].name;
+                    char       *name = PFprop_name_origin (n->prop, col);
+                    if (name) {
+                        curpos = PFarray_last (DOT);
+                        if (!started) {
+                            started = true;
+                            sep = "\\nname origin: ";
+                        }
+                        else if (curpos - startpos > 42) {
+                            sep = newline;
+                            startpos = curpos;
+                        }
+                        else
+                            sep = space;
+
+                        PFarray_printf (DOT, 
+                                        "%s%s=%s",
+                                        sep,
+                                        PFcol_str (col),
+                                        name);
+                    }
+                }
+            }
             if (*fmt == '+' || *fmt == 'A') {
                 /* if present print cardinality */
                 if (PFprop_card (n->prop))


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to