Changeset: d4ff6161b774 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d4ff6161b774
Added Files:
        monetdb5/optimizer/opt_cquery.c
        monetdb5/optimizer/opt_cquery.h
        sql/backends/monet5/Tests/cqstream00.sql
        sql/backends/monet5/Tests/cqstream01.sql
        sql/backends/monet5/Tests/cqstream02.sql
        sql/backends/monet5/Tests/cqstream03.sql
        sql/backends/monet5/Tests/cqstream08.sql
        sql/backends/monet5/Tests/cquery00.sql
        sql/backends/monet5/Tests/genbasket.c
Removed Files:
        monetdb5/optimizer/opt_timetrails.c
        monetdb5/optimizer/opt_timetrails.h
        sql/backends/monet5/Tests/cquery01.sql
        sql/backends/monet5/timetrails/Tests/TestingRecipe
        sql/backends/monet5/timetrails/Tests/export00.sql
        sql/backends/monet5/timetrails/Tests/genbasket.c
        sql/backends/monet5/timetrails/Tests/inputoutput.sql
        sql/backends/monet5/timetrails/Tests/iot01.sql
        sql/backends/monet5/timetrails/Tests/iot02.sql
        sql/backends/monet5/timetrails/Tests/iot03.sql
        sql/backends/monet5/timetrails/Tests/iot04.sql
        sql/backends/monet5/timetrails/Tests/iot06.sql
        sql/backends/monet5/timetrails/Tests/iot10.sql
        sql/backends/monet5/timetrails/Tests/iot11.sql
        sql/backends/monet5/timetrails/Tests/iot12.sql
        sql/backends/monet5/timetrails/Tests/iot13.sql
        sql/backends/monet5/timetrails/Tests/iot14.sql
        sql/backends/monet5/timetrails/Tests/iot15.sql
        sql/backends/monet5/timetrails/Tests/iot16.sql
        sql/backends/monet5/timetrails/Tests/petrinet00.mal
Modified Files:
        monetdb5/optimizer/Makefile.ag
        monetdb5/optimizer/opt_pipes.c
        monetdb5/optimizer/opt_prelude.c
        monetdb5/optimizer/opt_prelude.h
        monetdb5/optimizer/opt_support.c
        monetdb5/optimizer/opt_wrapper.c
        sql/backends/monet5/Tests/All
        sql/backends/monet5/timetrails/Tests/All
        sql/scripts/50_cquery.sql
Branch: timetrails
Log Message:

Cleanout the tests


diffs (truncated from 1216 to 300 lines):

diff --git a/monetdb5/optimizer/Makefile.ag b/monetdb5/optimizer/Makefile.ag
--- a/monetdb5/optimizer/Makefile.ag
+++ b/monetdb5/optimizer/Makefile.ag
@@ -24,6 +24,7 @@ lib_optimizer = {
                opt_candidates.c opt_candidates.h \
                opt_constants.c opt_constants.h \
                opt_costModel.c opt_costModel.h \
+               opt_cquery.c opt_cquery.h \
                opt_dataflow.c opt_dataflow.h \
                opt_deadcode.c opt_deadcode.h \
                opt_emptybind.c opt_emptybind.h \
@@ -33,7 +34,6 @@ lib_optimizer = {
                opt_querylog.c opt_querylog.h \
                opt_inline.c opt_inline.h \
                opt_jit.c opt_jit.h \
-               opt_timetrails.c opt_timetrails.h \
                opt_projectionpath.c opt_projectionpath.h \
                opt_macro.c opt_macro.h \
                opt_matpack.c opt_matpack.h \
diff --git a/monetdb5/optimizer/opt_timetrails.c 
b/monetdb5/optimizer/opt_cquery.c
rename from monetdb5/optimizer/opt_timetrails.c
rename to monetdb5/optimizer/opt_cquery.c
--- a/monetdb5/optimizer/opt_timetrails.c
+++ b/monetdb5/optimizer/opt_cquery.c
@@ -19,13 +19,13 @@
 
 /*
  * (author) M. Kersten
- * Assume simple queries . Clear out all non-timetrails schema related sql 
statements, except for the bare minimum.
+ * Assume simple queries . 
  */
 /*
  * We keep a flow dependency table to detect.
  */
 #include "monetdb_config.h"
-#include "opt_timetrails.h"
+#include "opt_cquery.h"
 #include "opt_deadcode.h"
 #include "mal_interpreter.h"    /* for showErrors() */
 #include "mal_builder.h"
@@ -39,7 +39,7 @@
        }
 
 str
-OPTtimetrailsImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci)
+OPTcqueryImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci)
 {
        int i, j, k, fnd, limit, slimit;
        InstrPtr r, p, *old;
@@ -60,14 +60,14 @@ OPTtimetrailsImplementation(Client cntxt
        for(i =0; i< mb->stop; i++){
                p= getInstrPtr(mb,i);
                if( getModuleId(p) == basketRef||
-                       getModuleId(p) == timetrailsRef)
+                       getModuleId(p) == cqueryRef)
                        break;
        }
        if( i == mb->stop)
                return MAL_SUCCEED;
 
 #ifdef DEBUG_OPT_IOT
-       mnstr_printf(cntxt->fdout, "#timetrails optimizer start\n");
+       mnstr_printf(cntxt->fdout, "#cquery optimizer start\n");
        printFunction(cntxt->fdout, mb, stk, LIST_MAL_DEBUG);
 #endif
        old = mb->stmt;
@@ -79,7 +79,7 @@ OPTtimetrailsImplementation(Client cntxt
                p = old[i];
                if( getModuleId(p)== basketRef && (getFunctionId(p)== 
registerRef || getFunctionId(p)== bindRef )  ){
 #ifdef DEBUG_OPT_IOT
-                       mnstr_printf(cntxt->fdout, "#timetrails stream table 
%s.%s\n", getModuleId(p), getFunctionId(p));
+                       mnstr_printf(cntxt->fdout, "#cquery stream table 
%s.%s\n", getModuleId(p), getFunctionId(p));
 #endif
                        schemas[btop]= getVarConstant(mb, getArg(p,2)).val.sval;
                        tables[btop]= getVarConstant(mb, getArg(p,3)).val.sval;
@@ -92,7 +92,7 @@ OPTtimetrailsImplementation(Client cntxt
                }
                if( getModuleId(p)== basketRef && getFunctionId(p) == appendRef 
){
 #ifdef DEBUG_OPT_IOT
-                       mnstr_printf(cntxt->fdout, "#timetrails stream table 
%s.%s\n", getModuleId(p), getFunctionId(p));
+                       mnstr_printf(cntxt->fdout, "#cquery stream table 
%s.%s\n", getModuleId(p), getFunctionId(p));
 #endif
                        schemas[btop]= getVarConstant(mb, getArg(p,2)).val.sval;
                        tables[btop]= getVarConstant(mb, getArg(p,3)).val.sval;
@@ -106,7 +106,7 @@ OPTtimetrailsImplementation(Client cntxt
                }
                if( getModuleId(p)== basketRef && getFunctionId(p) == updateRef 
){
 #ifdef DEBUG_OPT_IOT
-                       mnstr_printf(cntxt->fdout, "#timetrails stream table 
%s.%s\n", getModuleId(p), getFunctionId(p));
+                       mnstr_printf(cntxt->fdout, "#cquery stream table 
%s.%s\n", getModuleId(p), getFunctionId(p));
 #endif
                        schemas[btop]= getVarConstant(mb, getArg(p,2)).val.sval;
                        tables[btop]= getVarConstant(mb, getArg(p,3)).val.sval;
@@ -118,9 +118,9 @@ OPTtimetrailsImplementation(Client cntxt
                        if( j == btop)
                                btop++;
                }
-               if( getModuleId(p)== timetrailsRef && getFunctionId(p) == 
basketRef){
+               if( getModuleId(p)== cqueryRef && getFunctionId(p) == 
basketRef){
 #ifdef DEBUG_OPT_IOT
-                       mnstr_printf(cntxt->fdout, "#timetrails stream table 
%s.%s\n", getModuleId(p), getFunctionId(p));
+                       mnstr_printf(cntxt->fdout, "#cquery stream table 
%s.%s\n", getModuleId(p), getFunctionId(p));
 #endif
                        schemas[btop]= getVarConstant(mb, getArg(p,1)).val.sval;
                        tables[btop]= getVarConstant(mb, getArg(p,2)).val.sval;
@@ -134,7 +134,7 @@ OPTtimetrailsImplementation(Client cntxt
                        lastmvc = getArg(p,0);
                if (!cq && getModuleId(p) == sqlRef && getFunctionId(p) == 
affectedRowsRef )
                        lastmvc = getArg(p,0);
-               if( getModuleId(p)== timetrailsRef && getFunctionId(p) == 
tumbleRef){
+               if( getModuleId(p)== cqueryRef && getFunctionId(p) == 
tumbleRef){
                        lastmvc = getArg(p,1);
                }
        }
@@ -142,7 +142,7 @@ OPTtimetrailsImplementation(Client cntxt
                return MAL_SUCCEED;
 
 #ifdef DEBUG_OPT_IOT
-       mnstr_printf(cntxt->fdout, "#timetrails optimizer started with %d 
streams, mvc %d\n", btop,lastmvc);
+       mnstr_printf(cntxt->fdout, "#cquery optimizer started with %d streams, 
mvc %d\n", btop,lastmvc);
        printFunction(cntxt->fdout, mb, stk, LIST_MAL_DEBUG);
 #endif
        (void) stk;
@@ -200,7 +200,7 @@ OPTtimetrailsImplementation(Client cntxt
                        if (getModuleId(p) == sqlRef && getFunctionId(p) == 
tidRef ){
                                
getStreamTableInfo(getVarConstant(mb,getArg(p,2)).val.sval, 
getVarConstant(mb,getArg(p,3)).val.sval );
 #ifdef DEBUG_OPT_IOT
-                               mnstr_printf(cntxt->fdout, "#timetrails 
optimizer found stream %d\n",fnd);
+                               mnstr_printf(cntxt->fdout, "#cquery optimizer 
found stream %d\n",fnd);
 #endif
                                if( fnd){
                                        getModuleId(p) = basketRef;
@@ -225,7 +225,7 @@ OPTtimetrailsImplementation(Client cntxt
                                continue;
                        }
 
-                       if( getModuleId(p)== timetrailsRef && 
getFunctionId(p)==errorRef)
+                       if( getModuleId(p)== cqueryRef && 
getFunctionId(p)==errorRef)
                                noerror++;
                        if (p->token == ENDsymbol && btop > 0 && noerror==0) {
                                // empty all baskets used only when we are 
optimizing a cq
@@ -244,7 +244,7 @@ OPTtimetrailsImplementation(Client cntxt
                                setVarUDFtype(mb, j);
                                r->barrier = CATCHsymbol;
 
-                               r = newStmt(mb,timetrailsRef, errorRef);
+                               r = newStmt(mb,cqueryRef, errorRef);
                                r = pushStr(mb, r, getModuleId(old[0]));
                                r = pushStr(mb, r, getFunctionId(old[0]));
                                r = pushArgument(mb, r, j);
@@ -257,7 +257,7 @@ OPTtimetrailsImplementation(Client cntxt
                                setVarUDFtype(mb, j);
                                r->barrier = CATCHsymbol;
 
-                               r = newStmt(mb,timetrailsRef, errorRef);
+                               r = newStmt(mb,cqueryRef, errorRef);
                                r = pushStr(mb, r, getModuleId(old[0]));
                                r = pushStr(mb, r, getFunctionId(old[0]));
                                r = pushArgument(mb, r, j);
@@ -307,11 +307,11 @@ OPTtimetrailsImplementation(Client cntxt
        chkFlow(cntxt->fdout, mb);
        chkDeclarations(cntxt->fdout, mb);
     /* keep all actions taken as a post block comment */
-    snprintf(buf,256,"%-20s actions=%2d time=" LLFMT " usec","timetrails", 
btop, GDKusec() - usec);
+    snprintf(buf,256,"%-20s actions=%2d time=" LLFMT " usec","cquery", btop, 
GDKusec() - usec);
     newComment(mb,buf);
 
 #ifdef DEBUG_OPT_IOT
-       mnstr_printf(cntxt->fdout, "#timetrails optimizer final\n");
+       mnstr_printf(cntxt->fdout, "#cquery optimizer final\n");
        printFunction(cntxt->fdout, mb, stk, LIST_MAL_DEBUG);
 #endif
        GDKfree(alias);
@@ -319,5 +319,5 @@ OPTtimetrailsImplementation(Client cntxt
 
     if( btop > 0)
         return MAL_SUCCEED;
-       throw (MAL,"optimizer.timetrails", "The timetrails optimizer failed to 
start! (btop = %d)", btop);
+       throw (MAL,"optimizer.cquery", "The cquery optimizer failed to start! 
(btop = %d)", btop);
 }
diff --git a/monetdb5/optimizer/opt_timetrails.h 
b/monetdb5/optimizer/opt_cquery.h
rename from monetdb5/optimizer/opt_timetrails.h
rename to monetdb5/optimizer/opt_cquery.h
--- a/monetdb5/optimizer/opt_timetrails.h
+++ b/monetdb5/optimizer/opt_cquery.h
@@ -17,12 +17,12 @@
  * All Rights Reserved.
  */
 
-#ifndef _OPT_DATACELL_
-#define _OPT_DATACELL_
+#ifndef _OPT_TIMETRAILS_
+#define _OPT_TIMETRAILS_
 #include "opt_prelude.h"
 #include "opt_support.h"
 #include "opt_pipes.h"
 
-mal_export str OPTtimetrailsImplementation(Client cntxt, MalBlkPtr mb, 
MalStkPtr stk, InstrPtr pci);
+mal_export str OPTcqueryImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr 
stk, InstrPtr pci);
 
 #endif
diff --git a/monetdb5/optimizer/opt_pipes.c b/monetdb5/optimizer/opt_pipes.c
--- a/monetdb5/optimizer/opt_pipes.c
+++ b/monetdb5/optimizer/opt_pipes.c
@@ -202,10 +202,10 @@ static struct PIPELINES {
 //      "optimizer.oltp();"awaiting the autocommit front-end changes
         "optimizer.garbageCollector();",
         "stable", NULL, NULL, 1},
-       {"timetrails",
+       {"cquery_pipe",
         "optimizer.inline();"
         "optimizer.remap();"
-        "optimizer.timetrails();"
+        "optimizer.cquery();"
         "optimizer.costModel();"
         "optimizer.coercions();"
         "optimizer.evaluate();"
diff --git a/monetdb5/optimizer/opt_prelude.c b/monetdb5/optimizer/opt_prelude.c
--- a/monetdb5/optimizer/opt_prelude.c
+++ b/monetdb5/optimizer/opt_prelude.c
@@ -277,7 +277,7 @@ str subavgRef;
 str selectRef;
 str sortRef;
 str takeRef;
-str timetrailsRef;
+str cqueryRef;
 str transactionRef;
 str transaction_beginRef;
 str transaction_releaseRef;
@@ -561,7 +561,7 @@ void optimizerInit(void)
        subavgRef = putName("subavg");
        sortRef = putName("sort");
        takeRef= putName("take");
-       timetrailsRef = putName("timetrails");
+       cqueryRef = putName("cquery");
        transactionRef= putName("transaction");
        transaction_beginRef= putName("transaction_begin");
        transaction_releaseRef= putName("transaction_release");
diff --git a/monetdb5/optimizer/opt_prelude.h b/monetdb5/optimizer/opt_prelude.h
--- a/monetdb5/optimizer/opt_prelude.h
+++ b/monetdb5/optimizer/opt_prelude.h
@@ -268,7 +268,7 @@ mal_export  str sumRef;
 mal_export  str subsumRef;
 mal_export  str subavgRef;
 mal_export  str sortRef;
-mal_export  str timetrailsRef;
+mal_export  str cqueryRef;
 mal_export  str timestampRef;
 mal_export     str tumbleRef;
 mal_export  str takeRef;
diff --git a/monetdb5/optimizer/opt_support.c b/monetdb5/optimizer/opt_support.c
--- a/monetdb5/optimizer/opt_support.c
+++ b/monetdb5/optimizer/opt_support.c
@@ -421,7 +421,7 @@ hasSideEffects(MalBlkPtr mb, InstrPtr p,
                if (getFunctionId(p) == singleRef) return FALSE;
                return TRUE;
        }
-       if (getModuleId(p) == basketRef || getModuleId(p) == timetrailsRef){
+       if (getModuleId(p) == basketRef || getModuleId(p) == cqueryRef){
                return TRUE;
        }
        if( getModuleId(p) == mapiRef){
diff --git a/monetdb5/optimizer/opt_wrapper.c b/monetdb5/optimizer/opt_wrapper.c
--- a/monetdb5/optimizer/opt_wrapper.c
+++ b/monetdb5/optimizer/opt_wrapper.c
@@ -48,7 +48,7 @@
 #include "opt_remap.h"
 #include "opt_remoteQueries.h"
 #include "opt_reorder.h"
-#include "opt_timetrails.h"
+#include "opt_cquery.h"
 #include "opt_volcano.h"
 
 struct{
@@ -70,7 +70,7 @@ struct{
        {"garbageCollector", &OPTgarbageCollectorImplementation,0,0},
        {"generator", &OPTgeneratorImplementation,0,0},
        {"inline", &OPTinlineImplementation,0,0},
-    {"timetrails", &OPTtimetrailsImplementation,0,0},
+    {"cquery", &OPTcqueryImplementation,0,0},
        {"jit", &OPTjitImplementation,0,0},
        {"json", &OPTjsonImplementation,0,0},
        {"matpack", &OPTmatpackImplementation,0,0},
diff --git a/sql/backends/monet5/Tests/All b/sql/backends/monet5/Tests/All
--- a/sql/backends/monet5/Tests/All
+++ b/sql/backends/monet5/Tests/All
@@ -77,4 +77,11 @@ shutdown
 
 HAVE_HGE?int_notation_1e5
 
+cquery00
 cquery01
+
+cqstream00
+cqstream01
+cqstream02
+cqstream03
+cqstream08
diff --git a/sql/backends/monet5/Tests/cqstream00.sql 
b/sql/backends/monet5/Tests/cqstream00.sql
new file mode 100644
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to