Changeset: e559cfc07190 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e559cfc07190
Modified Files:
        monetdb5/optimizer/Makefile.ag
        monetdb5/optimizer/opt_support.c
        monetdb5/optimizer/opt_wrapper.c
        sql/backends/monet5/iot/Tests/bug05.stable.out
        sql/backends/monet5/iot/Tests/iot06.stable.out
        sql/backends/monet5/iot/Tests/iot11.stable.out
        sql/backends/monet5/iot/Tests/iot14.sql
        sql/backends/monet5/iot/Tests/iot14.stable.out
        sql/backends/monet5/iot/Tests/receptor00.stable.out
        sql/backends/monet5/iot/Tests/webtest.stable.out
        sql/backends/monet5/sql_execute.c
        sql/backends/monet5/sql_optimizer.c
        sql/server/rel_updates.c
        sql/test/Tests/setoptimizer.stable.out
        sql/test/Tests/setoptimizer.stable.out.Windows
Branch: iot
Log Message:

Merge jit with iot


diffs (truncated from 546 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
@@ -34,6 +34,7 @@ lib_optimizer = {
                opt_querylog.c opt_querylog.h \
                opt_inline.c opt_inline.h \
                opt_jit.c opt_jit.h \
+               opt_iot.c opt_iot.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_support.c b/monetdb5/optimizer/opt_support.c
--- a/monetdb5/optimizer/opt_support.c
+++ b/monetdb5/optimizer/opt_support.c
@@ -451,6 +451,9 @@ hasSideEffects(InstrPtr p, int strict)
                if( getFunctionId(p) == assertRef) return TRUE;
                return FALSE;
        }
+       if (getModuleId(p) == basketRef || getModuleId(p) == iotRef){
+               return TRUE;
+       }
        if (getModuleId(p) == constraintsRef)
                return FALSE;
        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
@@ -40,6 +40,7 @@
 #include "opt_garbageCollector.h"
 #include "opt_generator.h"
 #include "opt_inline.h"
+#include "opt_iot.h"
 #include "opt_jit.h"
 #include "opt_projectionpath.h"
 #include "opt_matpack.h"
@@ -75,6 +76,7 @@ struct{
        {"garbageCollector", &OPTgarbageCollectorImplementation},
        {"generator", &OPTgeneratorImplementation},
        {"inline", &OPTinlineImplementation},
+       {"iot", &OPTiotImplementation},
        {"projectionpath", &OPTprojectionpathImplementation},
        {"matpack", &OPTmatpackImplementation},
        {"json", &OPTjsonImplementation},
diff --git a/sql/backends/monet5/iot/Tests/bug05.stable.out 
b/sql/backends/monet5/iot/Tests/bug05.stable.out
--- a/sql/backends/monet5/iot/Tests/bug05.stable.out
+++ b/sql/backends/monet5/iot/Tests/bug05.stable.out
@@ -55,25 +55,23 @@ end user.petri_0;
 % 65 # length
 unsafe function user.sys_cquery():void;
     X_0 := sql.mvc();
-    X_24 := basket.register(X_0,"sys","testing",0);
-    X_28 := basket.lock(X_24,"sys","testing");
-barrier X_53 := language.dataflow();
-    C_1:bat[:oid] := basket.tid(X_0,"sys","testing");
-    X_4:bat[:timestamp] := basket.bind(X_24,"sys","testing","a");
-exit X_53;
-    X_9 := sql.append(X_28,"sys","testout","a",X_4);
+    X_23 := basket.register(X_0,"sys","testing",0);
+    X_27 := basket.lock(X_23,"sys","testing");
+    X_1:bat[:oid] := basket.tid(X_0,"sys","testing");
+    X_4:bat[:timestamp] := basket.bind(X_23,"sys","testing","a");
+    X_9 := sql.append(X_27,"sys","testout","a",X_4);
     X_11:bat[:int] := basket.bind(X_9,"sys","testing","b");
     X_15 := sql.append(X_9,"sys","testout","b",X_11);
     X_16:bat[:flt] := basket.bind(X_15,"sys","testing","c");
     X_20 := sql.append(X_15,"sys","testout","c",X_16);
-    X_29 := basket.tumble(X_20,"sys","testing");
+    X_28 := basket.tumble(X_20,"sys","testing");
 catch SQLexception:str;
     iot.error("user","cquery",SQLexception);
 exit SQLexception:str;
 catch MALexception:str;
     iot.error("user","cquery",MALexception);
 exit MALexception:str;
-    basket.unlock(X_29,"sys","testing");
+    basket.unlock(X_28,"sys","testing");
 end user.sys_cquery;
 #inline               actions= 0 time=1 usec 
 #candidates           actions= 1 time=1 usec 
diff --git a/sql/backends/monet5/iot/Tests/iot06.stable.out 
b/sql/backends/monet5/iot/Tests/iot06.stable.out
--- a/sql/backends/monet5/iot/Tests/iot06.stable.out
+++ b/sql/backends/monet5/iot/Tests/iot06.stable.out
@@ -50,14 +50,12 @@ end user.petri_0;
 % 63 # length
 unsafe function user.iot_cq06():void;
     X_0 := sql.mvc();
-    X_32 := basket.register(X_0,"iot","tmp06",0);
-    X_36 := basket.lock(X_32,"iot","tmp06");
-barrier X_61 := language.dataflow();
-    C_1:bat[:oid] := basket.tid(X_0,"iot","tmp06");
-    X_4:bat[:timestamp] := basket.bind(X_32,"iot","tmp06","t");
+    X_31 := basket.register(X_0,"iot","tmp06",0);
+    X_35 := basket.lock(X_31,"iot","tmp06");
+    X_1:bat[:oid] := basket.tid(X_0,"iot","tmp06");
+    X_4:bat[:timestamp] := basket.bind(X_31,"iot","tmp06","t");
     X_8 := aggr.min(X_4);
-exit X_61;
-    X_10 := sql.append(X_36,"iot","result","t",X_8);
+    X_10 := sql.append(X_35,"iot","result","t",X_8);
     X_12 := aggr.count(X_4);
     X_13 := calc.int(X_12);
     X_15 := sql.append(X_10,"iot","result","sensor",X_13);
@@ -66,14 +64,14 @@ exit X_61;
     X_24:dbl := aggr.avg(X_20);
     X_25 := calc.int(X_24,8,2);
     X_28 := sql.append(X_15,"iot","result","val",X_25);
-    X_37 := basket.tumble(X_28,"iot","tmp06");
+    X_36 := basket.tumble(X_28,"iot","tmp06");
 catch SQLexception:str;
     iot.error("user","cq06",SQLexception);
 exit SQLexception:str;
 catch MALexception:str;
     iot.error("user","cq06",MALexception);
 exit MALexception:str;
-    basket.unlock(X_37,"iot","tmp06");
+    basket.unlock(X_36,"iot","tmp06");
 end user.iot_cq06;
 #inline               actions= 0 time=2 usec 
 #candidates           actions= 1 time=1 usec 
diff --git a/sql/backends/monet5/iot/Tests/iot11.stable.out 
b/sql/backends/monet5/iot/Tests/iot11.stable.out
--- a/sql/backends/monet5/iot/Tests/iot11.stable.out
+++ b/sql/backends/monet5/iot/Tests/iot11.stable.out
@@ -43,15 +43,16 @@ Ready.
 % mal # name
 % clob # type
 % 80 # length
-function user.s6_1():void;
-    X_45:void := querylog.define("explain select * from 
sdel11;","iot_pipe",40);
+function user.s12_1():void;
+    X_45:void := querylog.define("explain select * from 
sdel11;","iot_pipe",41);
     X_0 := sql.mvc();
-    X_51 := basket.register(X_0,"iot","sdel11",0);
-    X_55 := basket.lock(X_51,"iot","sdel11");
+    X_50 := basket.register(X_0,"iot","sdel11",0);
+    X_54 := basket.lock(X_50,"iot","sdel11");
+    X_1:bat[:oid] := basket.tid(X_0,"iot","sdel11");
+    X_4:bat[:timestamp] := basket.bind(X_50,"iot","sdel11","t");
+    X_8:bat[:int] := basket.bind(X_50,"iot","sdel11","sensor");
+    X_11:bat[:int] := basket.bind(X_50,"iot","sdel11","val");
 barrier X_80 := language.dataflow();
-    X_4:bat[:timestamp] := basket.bind(X_51,"iot","sdel11","t");
-    X_8:bat[:int] := basket.bind(X_51,"iot","sdel11","sensor");
-    X_11:bat[:int] := basket.bind(X_51,"iot","sdel11","val");
     X_15 := bat.new(nil:str);
     X_17 := bat.new(nil:str);
     X_18 := bat.new(nil:str);
@@ -74,22 +75,22 @@ barrier X_80 := language.dataflow();
     X_43 := bat.append(X_36,2);
 exit X_80;
     sql.resultSet(X_37,X_38,X_39,X_41,X_43,X_4,X_8,X_11);
-    X_56 := basket.tumble(X_55,"iot","sdel11");
+    X_55 := basket.tumble(X_54,"iot","sdel11");
 catch SQLexception:str;
-    iot.error("user","s6_1",SQLexception);
+    iot.error("user","s12_1",SQLexception);
 exit SQLexception:str;
 catch MALexception:str;
-    iot.error("user","s6_1",MALexception);
+    iot.error("user","s12_1",MALexception);
 exit MALexception:str;
-    basket.unlock(X_56,"iot","sdel11");
-end user.s6_1;
-#inline               actions= 0 time=1 usec 
-#candidates           actions= 1 time=1 usec 
-#remap                actions= 0 time=4 usec 
-#iot                  actions= 1 time=27 usec 
-#costmodel            actions= 1 time=1 usec 
-#coercion             actions= 0 time=1 usec 
-#evaluate             actions= 0 time=3 usec 
+    basket.unlock(X_55,"iot","sdel11");
+end user.s12_1;
+#inline               actions= 0 time=0 usec 
+#remap                actions= 0 time=2 usec 
+#iot                  actions= 1 time=28 usec 
+#costmodel            actions= 1 time=2 usec 
+#coercion             actions= 0 time=2 usec 
+#evaluate             actions= 0 time=4 usec 
+#emptybind            actions= 0 time=6 usec 
 #aliases              actions= 0 time=7 usec 
 #mergetable           actions= 0 time=32 usec 
 #deadcode             actions= 1 time=6 usec 
@@ -110,27 +111,27 @@ end user.s6_1;
 % mal # name
 % clob # type
 % 95 # length
-function user.s7_1(A0:int):void;
+function user.s14_1():void;
     X_19:void := querylog.define("explain delete from sdel11 where sensor = 
2;","iot_pipe",21);
     X_0 := sql.mvc();
-    X_25 := basket.register(X_0,"iot","sdel11",0);
-    X_29 := basket.lock(X_25,"iot","sdel11");
-    C_1:bat[:oid] := basket.tid(X_0,"iot","sdel11");
-    X_4:bat[:int] := basket.bind(X_25,"iot","sdel11","sensor");
-    C_9 := algebra.subselect(X_4,A0,A0,true,false,false);
-    X_13 := algebra.projection(C_9,C_1);
-    X_15 := basket.delete(X_25,"iot","sdel11",X_13);
+    X_24 := basket.register(X_0,"iot","sdel11",0);
+    X_28 := basket.lock(X_24,"iot","sdel11");
+    X_1:bat[:oid] := basket.tid(X_0,"iot","sdel11");
+    X_4:bat[:int] := basket.bind(X_24,"iot","sdel11","sensor");
+    C_9 := algebra.subselect(X_4,2,2,true,false,false);
+    X_13 := algebra.projection(C_9,X_1);
+    X_15 := basket.delete(X_24,"iot","sdel11",X_13);
     X_16 := aggr.count(X_13);
     sql.affectedRows(X_15,X_16);
-    X_30 := basket.tumble(X_29,"iot","sdel11");
+    X_29 := basket.tumble(X_28,"iot","sdel11");
 catch SQLexception:str;
-    iot.error("user","s7_1",SQLexception);
+    iot.error("user","s14_1",SQLexception);
 exit SQLexception:str;
 catch MALexception:str;
-    iot.error("user","s7_1",MALexception);
+    iot.error("user","s14_1",MALexception);
 exit MALexception:str;
-    basket.unlock(X_30,"iot","sdel11");
-end user.s7_1;
+    basket.unlock(X_29,"iot","sdel11");
+end user.s14_1;
 # optimizer.mitosis()
 # optimizer.dataflow()
 #inline               actions= 0 time=1 usec 
diff --git a/sql/backends/monet5/iot/Tests/iot14.sql 
b/sql/backends/monet5/iot/Tests/iot14.sql
--- a/sql/backends/monet5/iot/Tests/iot14.sql
+++ b/sql/backends/monet5/iot/Tests/iot14.sql
@@ -20,6 +20,7 @@ insert into sdel values('2005-09-23 12:3
 insert into sdel values('2005-09-23 12:34:26.736',4,12.34);
 insert into sdel values('2005-09-23 12:34:26.736',3,12.34);
 select * from sdel;
+select count(*) from sdel;
 
 call iot.resume();
 -- wait a few seconds
diff --git a/sql/backends/monet5/iot/Tests/iot14.stable.out 
b/sql/backends/monet5/iot/Tests/iot14.stable.out
--- a/sql/backends/monet5/iot/Tests/iot14.stable.out
+++ b/sql/backends/monet5/iot/Tests/iot14.stable.out
@@ -49,23 +49,21 @@ end user.petri_0;
 % 61 # length
 unsafe function user.iot_sdel00():void;
     X_0 := sql.mvc();
-    X_20 := basket.register(X_0,"iot","sdel",0);
-    X_24 := basket.lock(X_20,"iot","sdel");
-barrier X_49 := language.dataflow();
-    C_1:bat[:oid] := basket.tid(X_0,"iot","sdel");
-    X_4:bat[:int] := basket.bind(X_20,"iot","sdel","sensor");
+    X_19 := basket.register(X_0,"iot","sdel",0);
+    X_23 := basket.lock(X_19,"iot","sdel");
+    X_1:bat[:oid] := basket.tid(X_0,"iot","sdel");
+    X_4:bat[:int] := basket.bind(X_19,"iot","sdel","sensor");
     C_10 := algebra.subselect(X_4,3,3,true,false,false);
-    X_14 := algebra.projection(C_10,C_1);
-    basket.delete(X_20,"iot","sdel",X_14);
-    X_25 := basket.tumble(X_24,"iot","sdel");
-exit X_49;
+    X_14 := algebra.projection(C_10,X_1);
+    basket.delete(X_19,"iot","sdel",X_14);
+    X_24 := basket.tumble(X_23,"iot","sdel");
 catch SQLexception:str;
     iot.error("user","sdel00",SQLexception);
 exit SQLexception:str;
 catch MALexception:str;
     iot.error("user","sdel00",MALexception);
 exit MALexception:str;
-    basket.unlock(X_25,"iot","sdel");
+    basket.unlock(X_24,"iot","sdel");
 end user.iot_sdel00;
 #inline               actions= 0 time=1 usec 
 #candidates           actions= 1 time=0 usec 
@@ -111,8 +109,12 @@ end user.iot_sdel00;
 [ 2005-09-23 12:34:26.736000,  3,      12.34   ]
 [ 2005-09-23 12:34:26.736000,  4,      12.34   ]
 [ 2005-09-23 12:34:26.736000,  3,      12.34   ]
-#call iot.stop();
-#pnstop waiting for  0 queries 
+#select count(*) from sdel;
+% iot.L1 # table_name
+% L1 # name
+% bigint # type
+% 1 # length
+[ 4    ]
 #select 'final state';
 % .L # table_name
 % single_value # name
diff --git a/sql/backends/monet5/iot/Tests/receptor00.stable.out 
b/sql/backends/monet5/iot/Tests/receptor00.stable.out
--- a/sql/backends/monet5/iot/Tests/receptor00.stable.out
+++ b/sql/backends/monet5/iot/Tests/receptor00.stable.out
@@ -35,14 +35,14 @@ Ready.
 % mal # name
 % clob # type
 % 127 # length
-function user.s5_1(A0:str,A1:str,A2:str):void;
+function user.s10_1():void;
     X_9:void := querylog.define("explain call 
iot.import(\\'iot\\',\\'temps\\', 
concat(basketdir,\\'1\\'));","default_pipe",7);
     X_0 := sql.mvc();
     X_5:str := sql.getVariable(X_0,"basketdir");
-    X_7:str := calc.+(X_5,A2);
-    iot.import(A0,A1,X_7);
-end user.s5_1;
-#inline               actions= 0 time=0 usec 
+    X_7:str := calc.+(X_5,"1");
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to