Changeset: 2569ffa9872b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2569ffa9872b
Modified Files:
        monetdb5/optimizer/opt_prelude.c
        monetdb5/optimizer/opt_strimps.c
Branch: string_imprints
Log Message:

Add filtering to the plan (WIP)


diffs (63 lines):

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
@@ -591,6 +591,7 @@ void optimizerInit(void)
        stoptraceRef = putName("stoptrace");
        streamsRef = putName("streams");
        strimpsRef = putName("strimps");
+       strimpFilterSelectRef = putName("strimpfilterselect");
        strRef = putName("str");
        subavgRef = putName("subavg");
        subcountRef = putName("subcount");
diff --git a/monetdb5/optimizer/opt_strimps.c b/monetdb5/optimizer/opt_strimps.c
--- a/monetdb5/optimizer/opt_strimps.c
+++ b/monetdb5/optimizer/opt_strimps.c
@@ -26,10 +26,13 @@ OPTstrimpsImplementation(Client cntxt, M
        int i, limit;
        // int mvcvar = -1;
        int count=0;
-       InstrPtr p,q, *old = mb->stmt;
+       InstrPtr p,q,r, *old = mb->stmt;
        char buf[256];
        lng usec = GDKusec();
        str msg = MAL_SUCCEED;
+       /* int res, nvar; */
+       /* ValRecord cst; */
+       int res;
 
        (void) pci;
        (void) cntxt;
@@ -53,10 +56,24 @@ OPTstrimpsImplementation(Client cntxt, M
                        pushInstruction(mb, q);
                        typeChecker(cntxt->usermodule, mb, q, mb->stop-1, TRUE);
 
+                       /* cst.vtype = TYPE_bit; */
+                       /* nvar = defConstant(mb, TYPE_bit, &cst); */
+                       r = newInstruction(mb, strimpsRef, 
strimpFilterSelectRef);
+                       res = newTmpVariable(mb, newBatType(TYPE_oid));
+                       setDestVar(r, res);
+                       r = addArgument(mb, r, getArg(p, 1));
+                       r = addArgument(mb, r, getArg(p, 2));
+                       r = addArgument(mb, r, getArg(p, 3));
+                       r = addArgument(mb, r, getArg(p, 6));
+
+                       pushInstruction(mb, r);
+                       // typeChecker(cntxt->usermodule, mb, r, mb->stop-1, 
TRUE);
+
                        count++;
                }
                pushInstruction(mb, p);
        }
+       GDKfree(old);
 
     /* Defense line against incorrect plans */
     if( count){
@@ -68,7 +85,7 @@ OPTstrimpsImplementation(Client cntxt, M
     }
     /* keep all actions taken as a post block comment */
        usec = GDKusec()- usec;
-    snprintf(buf,256,"%-20s actions=%2d time=" LLFMT " 
usec","volcano",count,usec);
+    snprintf(buf,256,"%-20s actions=%2d time=" LLFMT " 
usec","strimps",count,usec);
     newComment(mb,buf);
        if( count > 0)
                addtoMalBlkHistory(mb);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to