Changeset: 20f7b1dd3807 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=20f7b1dd3807
Modified Files:
        MonetDB5/conf/monetdb5.conf.in
        MonetDB5/src/optimizer/opt_datacyclotron.mx
Branch: default
Log Message:

The sql.bind contains an extra argument, ptr for mvc.
Lets correct the optimizer to take that extra argument in consideration.

We now have a mal instruction
addReg
Which allows us to add register partitions in the optimizer catalog.
Like this, we can debug and test the optimizer without the datacyclotron module.


diffs (68 lines):

diff -r b870dd0201f7 -r 20f7b1dd3807 MonetDB5/conf/monetdb5.conf.in
--- a/MonetDB5/conf/monetdb5.conf.in    Thu Jun 17 07:59:02 2010 +0200
+++ b/MonetDB5/conf/monetdb5.conf.in    Thu Jun 17 13:05:14 2010 +0200
@@ -187,7 +187,7 @@
 # only.
 
 # Set and define the default pipeline
-sql_optimizer=default_pipe
+sql_optimizer=datacyclotron_pipe
 
 # The minimal pipeline necessary by the server to operate correctly
 minimal_pipe=inline,remap,deadcode,multiplex,garbageCollector
diff -r b870dd0201f7 -r 20f7b1dd3807 MonetDB5/src/optimizer/opt_datacyclotron.mx
--- a/MonetDB5/src/optimizer/opt_datacyclotron.mx       Thu Jun 17 07:59:02 
2010 +0200
+++ b/MonetDB5/src/optimizer/opt_datacyclotron.mx       Thu Jun 17 13:05:14 
2010 +0200
@@ -29,6 +29,11 @@
 address OPTdatacyclotron
 comment "Datacyclotron code injection";
 
+
+pattern addReg(sch:str, tab:str, col:str, acc:int, f_bun:int, l_bun:int):int
+address addRegWrap
+comment "Add a regist for partition";
+
 @-
 
 The number of overloaded instructions is kept to a minimum.
@@ -75,6 +80,25 @@
 #include "mal_instruction.h"
 
 str
+addRegWrap (Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pc) {
+       int *res = (int*) getArgReference(stk,pc,0);
+       str *sch = (str*) getArgReference(stk,pc,1);
+       str *tab = (str*) getArgReference(stk,pc,2);
+       str *col = (str*) getArgReference(stk,pc,3);
+       int acc = *(int*) getArgReference(stk,pc,4);
+       int f_b = *(int*) getArgReference(stk,pc,5);
+       int l_b = *(int*) getArgReference(stk,pc,6);
+
+       (void) res;
+       (void) cntxt;
+       (void) mb;
+
+       addRegist(*sch, *tab, *col, acc, f_b, l_b);
+
+       return MAL_SUCCEED;
+}
+
+str
 printRegists(void) {
        DCYcatalog *reg = NULL;
        int chunks = 0, parts = 0;
@@ -225,10 +249,10 @@
                if (getModuleId(p)== sqlRef && (getFunctionId(p) == bindRef) ) {
 
                        /*Check if the BAT is a datacyclotron BAT*/
-                       str sch      = getVarConstant(mb, getArg(p,1)).val.sval;
-                       str tab      = getVarConstant(mb, getArg(p,2)).val.sval;
-                       str col      = getVarConstant(mb, getArg(p,3)).val.sval;
-                       int acc      = getVarConstant(mb, getArg(p,4)).val.ival;
+                       str sch      = getVarConstant(mb, getArg(p,2)).val.sval;
+                       str tab      = getVarConstant(mb, getArg(p,3)).val.sval;
+                       str col      = getVarConstant(mb, getArg(p,4)).val.sval;
+                       int acc      = getVarConstant(mb, getArg(p,5)).val.ival;
 
                        regs[getArg(p,0)] = findRegist(sch, tab, col, acc);
 
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to