Changeset: 4d17f38801a0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4d17f38801a0
Modified Files:
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql_optimizer.c
Branch: tracer
Log Message:

Added GDKtracer -> rel_bin.c && sql_optimizer.c


diffs (75 lines):

diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -19,6 +19,7 @@
 #include "rel_optimizer.h"
 #include "sql_env.h"
 #include "sql_optimizer.h"
+#include "gdk_tracer.h"
 
 #define OUTER_ZERO 64
 
@@ -98,7 +99,7 @@ print_stmtlist(sql_allocator *sa, stmt *
                        const char *rnme = table_name(sa, n->data);
                        const char *nme = column_name(sa, n->data);
 
-                       fprintf(stderr, "%s.%s\n", rnme ? rnme : "(null!)", nme 
? nme : "(null!)");
+                       INFO(SQL_ALL, "%s.%s\n", rnme ? rnme : "(null!)", nme ? 
nme : "(null!)");
                }
        }
 }
@@ -724,7 +725,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l
                if (s && grp)
                        s = stmt_project(be, ext, s);
                if (!s && right) {
-                       fprintf(stderr, "could not find %s.%s\n", (char*)e->l, 
(char*)e->r);
+                       CRITICAL(SQL_ALL, "Could not find %s.%s\n", 
(char*)e->l, (char*)e->r);
                        print_stmtlist(sql->sa, left);
                        print_stmtlist(sql->sa, right);
                        assert(s);
diff --git a/sql/backends/monet5/sql_optimizer.c 
b/sql/backends/monet5/sql_optimizer.c
--- a/sql/backends/monet5/sql_optimizer.c
+++ b/sql/backends/monet5/sql_optimizer.c
@@ -21,6 +21,7 @@
 #include "sql_scenario.h"
 #include "sql_gencode.h"
 #include "opt_pipes.h"
+#include "gdk_tracer.h"
 
 /* calculate the footprint for optimizer pipe line choices
  * and identify empty columns upfront for just in time optimizers.
@@ -108,14 +109,14 @@ SQLgetSpace(mvc *m, MalBlkPtr mb, int pr
                                space += size;  // accumulate once per table
                                //lasttable = tname;     invalidate this attempt
                                if( !prepare && size == 0  && ! t->system){
-                                       //fprintf(stderr,"found empty column 
%s.%s.%s prepare %d size "LLFMT"\n",sname,tname,cname,prepare,size);
+                                       DEBUG(SQL_ALL, "Found empty column 
%s.%s.%s prepare %d size "LLFMT"\n", sname, tname, cname, prepare, size);
                                        setFunctionId(p, emptybindRef);
                                }
                        }
                }
                if (getModuleId(p) == sqlRef && (getFunctionId(p) == 
bindidxRef)) {
                        char *sname = getVarConstant(mb, getArg(p, 1 + 
p->retc)).val.sval;
-                       //char *tname = getVarConstant(mb, getArg(p, 2 + 
p->retc)).val.sval;
+                       char *tname = getVarConstant(mb, getArg(p, 2 + 
p->retc)).val.sval;
                        char *idxname = getVarConstant(mb, getArg(p, 3 + 
p->retc)).val.sval;
                        int access = getVarConstant(mb, getArg(p, 4 + 
p->retc)).val.ival;
                        sql_schema *s = mvc_bind_schema(m, sname);
@@ -135,7 +136,7 @@ SQLgetSpace(mvc *m, MalBlkPtr mb, int pr
 
                                                if( !prepare && size == 0 && ! 
i->t->system){
                                                        setFunctionId(p, 
emptybindidxRef);
-                                                       //fprintf(stderr,"found 
empty column %s.%s.%s prepare %d size 
"LLFMT"\n",sname,tname,idxname,prepare,size);
+                                                       DEBUG(SQL_ALL, "Found 
empty column %s.%s.%s prepare %d size "LLFMT"\n", sname, tname, idxname, 
prepare, size);
                                                }
                                                BBPunfix(b->batCacheid);
                                        }
@@ -178,7 +179,7 @@ addOptimizers(Client c, MalBlkPtr mb, ch
        if(space && (pipe == NULL || strcmp(pipe,"default_pipe")== 0)){
                if( space > (lng)(0.8 * MT_npages() * MT_pagesize())  && 
GDKnr_threads > 1){
                        pipe = "volcano_pipe";
-                       //fprintf(stderr, "#use volcano optimizer pipeline? 
%zu\n", space);
+                       DEBUG(SQL_ALL, "Use volcano optimizer pipeline? Space: 
%zu\n", space);
                }else
                        pipe = "default_pipe";
        } else
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to