Re: MonetDB: Feb2013 - opt_support.c & opt_wrapper.c: "coercion" -> ...
Changeset: 30c2d470a73d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=30c2d470a73d Modified Files: monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out monetdb5/optimizer/opt_support.c monetdb5/optimizer/opt_wrapper.c sql/backends/monet5/UDF/Tests/udf-fuse.stable.out sql/backends/monet5/UDF/Tests/udf-reverse.stable.out sql/test/BugTracker-2009/Tests/POWER_vs_prod.SF-2596114.stable.out sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.stable.out Branch: Feb2013 Log Message:
opt_support.c & opt_wrapper.c: "coercion" -> "coercions", i.e., using the correct optimizer name "coercions" to ensure the optimizer is indeed activated/used.
Approved related changes in test output (modified MAL plans due to now active coercions optimizer).
This should fix bug 3151. ^!^^ Typo: this should read bug 3251
Thanks to Pete Hollobon for reporting and proving the initial fix!
Open question:
Why is an incorrect / non-exiting optimizer name silently ignored??
diffs (truncated from 413 to 300 lines):
diff --git a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out --- a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out +++ b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out @@ -61,15 +61,15 @@ Ready. % .explain # table_name % mal # name % clob # type -% 178 # length +% 153 # length function user.s2_1{autoCommit=true}():void; X_2 := sql.mvc(); - (X_5:bat[:oid,:int] ,X_6:bat[:oid,:int] ,X_7:bat[:oid,:int] ) := sql.copy_from("sys":str,"ttt":str,"|":str,"\\n":str,nil:str,"null":str,"/:\\tmp/xyz":str,-1:lng,0:lng,0:int); - X_9 := sql.append(X_2,"sys","ttt","a",X_5); - X_11 := sql.append(X_9,"sys","ttt","b",X_6); - X_15 := sql.append(X_11,"sys","ttt","c",X_7); - X_16 := aggr.count(X_7); - sql.affectedRows(X_15,X_16,""); + (X_13:bat[:oid,:int] ,X_14:bat[:oid,:int] ,X_15:bat[:oid,:int] ) := sql.copy_from("sys","ttt","|","\\n",nil:str,"null","/:\\tmp/xyz",-1:lng,0:lng,0); + X_17 := sql.append(X_2,"sys","ttt","a",X_13); + X_19 := sql.append(X_17,"sys","ttt","b",X_14); + X_23 := sql.append(X_19,"sys","ttt","c",X_15); + X_24 := aggr.count(X_15); + sql.affectedRows(X_23,X_24,""); end s2_1; # optimizer.mitosis() # optimizer.dataflow() @@ -89,15 +89,15 @@ end s2_1; % .explain # table_name % mal # name % clob # type -% 178 # length +% 153 # length function user.s5_1{autoCommit=true}():void; X_2 := sql.mvc(); - (X_5:bat[:oid,:int] ,X_6:bat[:oid,:int] ,X_7:bat[:oid,:int] ) := sql.copy_from("sys":str,"ttt":str,"|":str,"\\n":str,nil:str,"null":str,"/:\\tmp/xyz":str,-1:lng,0:lng,0:int); - X_9 := sql.append(X_2,"sys","ttt","a",X_5); - X_11 := sql.append(X_9,"sys","ttt","b",X_6); - X_16 := aggr.count(X_7); - X_15 := sql.append(X_11,"sys","ttt","c",X_7); - sql.affectedRows(X_15,X_16,""); + (X_13:bat[:oid,:int] ,X_14:bat[:oid,:int] ,X_15:bat[:oid,:int] ) := sql.copy_from("sys","ttt","|","\\n",nil:str,"null","/:\\tmp/xyz",-1:lng,0:lng,0); + X_17 := sql.append(X_2,"sys","ttt","a",X_13); + X_19 := sql.append(X_17,"sys","ttt","b",X_14); + X_24 := aggr.count(X_15); + X_23 := sql.append(X_19,"sys","ttt","c",X_15); + sql.affectedRows(X_23,X_24,""); end s5_1; # optimizer.mitosis() # optimizer.dataflow() 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 @@ -144,7 +144,7 @@ struct OPTcatalog { {"groups", 0, 0, 0, DEBUG_OPT_GROUPS}, {"aliases", 0, 0, 0, DEBUG_OPT_ALIASES}, {"cluster", 0, 0, 0, DEBUG_OPT_CLUSTER}, -{"coercion", 0, 0, 0, DEBUG_OPT_COERCION}, +{"coercions", 0, 0, 0, DEBUG_OPT_COERCION}, {"commonTerms", 0, 0, 0, DEBUG_OPT_COMMONTERMS}, {"compress", 0, 0, 0, DEBUG_OPT_COMPRESS}, {"constants", 0, 0, 0, DEBUG_OPT_CONSTANTS}, 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 @@ -84,7 +84,7 @@ struct{ {"aliases", &OPTaliasesImplementation}, {"centipede", &OPTcentipedeImplementation}, {"cluster", &OPTclusterImplementation}, - {"coercion", &OPTcoercionImplementation}, + {"coercions", &OPTcoercionImplementation}, {"commonTerms", &OPTcommonTermsImplementation}, {"compression", &OPTcompressionImplementation}, {"costModel", &OPTcostModelImplementation}, diff --git a/sql/backends/monet5/UDF/Tests/udf-fuse.stable.out b/sql/backends/monet5/UDF/Tests/udf-fuse.stable.out --- a/sql/backends/monet5/UDF/Tests/udf-fuse.stable.out +++ b/sql/backends/monet5/UDF/Tests/udf-fuse.stable.out @@ -27,10 +27,10 @@ Ready. % .explain # table_name % mal # name % clob # type -% 76 # length +% 72 # length function user.s0_1{autoCommit=true}(A0:bte,A1:bte):void; X_4 := udf.fuse(A0,A1); - sql.exportValue(1,".","fuse_single_value":str,"smallint",16,0,6,X_4,""); + sql.exportValue(1,".","fuse_single_value","smallint",16,0,6,X_4,""); end s0_1; # optimizer.mitosis() # optimizer.dataflow() @@ -44,10 +44,10 @@ end s0_1; % .explain # table_name % mal # name % clob # type -% 71 # length +% 67 # length function user.s1_1{autoCommit=true}(A0:sht,A1:sht):void; X_4 := udf.fuse(A0,A1); - sql.exportValue(1,".","fuse_single_value":str,"int",32,0,6,X_4,""); + sql.exportValue(1,".","fuse_single_value","int",32,0,6,X_4,""); end s1_1; #select fuse(1000,2000); % . # table_name @@ -59,10 +59,10 @@ end s1_1; % .explain # table_name % mal # name % clob # type -% 74 # length +% 70 # length function user.s2_1{autoCommit=true}(A0:int,A1:int):void; X_4 := udf.fuse(A0,A1); - sql.exportValue(1,".","fuse_single_value":str,"bigint",64,0,6,X_4,""); + sql.exportValue(1,".","fuse_single_value","bigint",64,0,6,X_4,""); end s2_1; #select fuse(1000000,2000000); % . # table_name diff --git a/sql/backends/monet5/UDF/Tests/udf-reverse.stable.out b/sql/backends/monet5/UDF/Tests/udf-reverse.stable.out --- a/sql/backends/monet5/UDF/Tests/udf-reverse.stable.out +++ b/sql/backends/monet5/UDF/Tests/udf-reverse.stable.out @@ -48,10 +48,10 @@ Ready. % .explain # table_name % mal # name % clob # type -% 74 # length +% 70 # length function user.s0_1{autoCommit=true}(A0:str):void; X_3 := udf.reverse(A0); - sql.exportValue(1,".","reverse_single_value":str,"clob",0,0,4,X_3,""); + sql.exportValue(1,".","reverse_single_value","clob",0,0,4,X_3,""); end s0_1; #select reverse('MonetDB'); % . # table_name @@ -81,7 +81,7 @@ end s0_1; % .explain # table_name % mal # name % clob # type -% 62 # length +% 60 # length function user.s3_1{autoCommit=true}():void; X_2 := sql.mvc(); X_3:bat[:oid,:oid] := sql.tid(X_2,"sys","udf_reverse"); @@ -92,7 +92,7 @@ function user.s3_1{autoCommit=true}():vo X_15 := algebra.leftfetchjoin(X_3,X_14); X_16:bat[:oid,:str] := batudf.reverse(X_15); X_18 := sql.resultSet(1,1,X_16); - sql.rsColumn(X_18,"sys.","reverse_x":str,"clob",0,0,X_16); + sql.rsColumn(X_18,"sys.","reverse_x","clob",0,0,X_16); X_22 := io.stdout(); sql.exportResult(X_22,X_18); end s3_1; diff --git a/sql/test/BugTracker-2009/Tests/POWER_vs_prod.SF-2596114.stable.out b/sql/test/BugTracker-2009/Tests/POWER_vs_prod.SF-2596114.stable.out --- a/sql/test/BugTracker-2009/Tests/POWER_vs_prod.SF-2596114.stable.out +++ b/sql/test/BugTracker-2009/Tests/POWER_vs_prod.SF-2596114.stable.out @@ -27,7 +27,7 @@ Ready. % .explain # table_name % mal # name % clob # type -% 63 # length +% 59 # length function user.s0_1{autoCommit=true}(A0:dbl):void; X_3 := sql.mvc(); X_4:bat[:oid,:oid] := sql.tid(X_3,"sys","sf_2596114"); @@ -38,7 +38,7 @@ function user.s0_1{autoCommit=true}(A0:d X_16 := algebra.leftfetchjoin(X_4,X_15); X_17:bat[:oid,:dbl] := batmmath.pow(X_16,A0); X_19 := sql.resultSet(1,1,X_17); - sql.rsColumn(X_19,"sys.","power_x":str,"double",53,0,X_17); + sql.rsColumn(X_19,"sys.","power_x","double",53,0,X_17); X_24 := io.stdout(); sql.exportResult(X_24,X_19); end s0_1; @@ -46,7 +46,7 @@ end s0_1; % .explain # table_name % mal # name % clob # type -% 65 # length +% 61 # length function user.s1_1{autoCommit=true}():void; X_2 := sql.mvc(); X_3:bat[:oid,:oid] := sql.tid(X_2,"sys","sf_2596114"); @@ -57,7 +57,7 @@ function user.s1_1{autoCommit=true}():vo X_15 := algebra.leftfetchjoin(X_3,X_14); X_16:bat[:oid,:dbl] := batcalc.*(X_15,X_15); X_18 := sql.resultSet(1,1,X_16); - sql.rsColumn(X_18,"sys.","sql_mul_x":str,"double",53,0,X_16); + sql.rsColumn(X_18,"sys.","sql_mul_x","double",53,0,X_16); X_23 := io.stdout(); sql.exportResult(X_23,X_18); end s1_1; diff --git a/sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.stable.out b/sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.stable.out --- a/sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.stable.out +++ b/sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.stable.out @@ -34,22 +34,22 @@ function user.s0_1(A0:str):void; X_2 := sql.mvc(); X_6 := sql.bind(X_2,"sys","functions","name",0); X_3:bat[:oid,:oid] := sql.tid(X_2,"sys","functions"); - X_45 := algebra.likesubselect(X_6,X_3,A0,"":str,false); + X_45 := algebra.likesubselect(X_6,X_3,A0,"",false); (X_9,r1_9) := sql.bind(X_2,"sys","functions","name",2); - X_46 := algebra.likesubselect(r1_9,A0,"":str,false); + X_46 := algebra.likesubselect(r1_9,A0,"",false); X_12 := sql.bind(X_2,"sys","functions","name",1); - X_47 := algebra.likesubselect(X_12,X_3,A0,"":str,false); - X_14 := sql.subdelta(X_45,X_9,X_46,X_47); - X_16 := sql.projectdelta(X_14,X_6,X_9,r1_9,X_12); - X_17 := sql.bind(X_2,"sys","functions","func",0); - (X_19,r1_28) := sql.bind(X_2,"sys","functions","func",2); - X_21 := sql.bind(X_2,"sys","functions","func",1); - X_22 := sql.projectdelta(X_14,X_17,X_19,r1_28,X_21); - X_23 := sql.resultSet(2,1,X_16); - sql.rsColumn(X_23,"sys.functions","name","varchar",256,0,X_16); - sql.rsColumn(X_23,"sys.functions","func","varchar",8196,0,X_22); - X_32 := io.stdout(); - sql.exportResult(X_32,X_23); + X_47 := algebra.likesubselect(X_12,X_3,A0,"",false); + X_15 := sql.subdelta(X_45,X_9,X_46,X_47); + X_17 := sql.projectdelta(X_15,X_6,X_9,r1_9,X_12); + X_18 := sql.bind(X_2,"sys","functions","func",0); + (X_20,r1_28) := sql.bind(X_2,"sys","functions","func",2); + X_22 := sql.bind(X_2,"sys","functions","func",1); + X_23 := sql.projectdelta(X_15,X_18,X_20,r1_28,X_22); + X_24 := sql.resultSet(2,1,X_17); + sql.rsColumn(X_24,"sys.functions","name","varchar",256,0,X_17); + sql.rsColumn(X_24,"sys.functions","func","varchar",8196,0,X_23); + X_33 := io.stdout(); + sql.exportResult(X_33,X_24); end s0_1; #explain select name,func from functions where name not like '%optimizers%'; % .explain # table_name @@ -60,22 +60,22 @@ function user.s1_1(A0:str):void; X_2 := sql.mvc(); X_6 := sql.bind(X_2,"sys","functions","name",0); X_3:bat[:oid,:oid] := sql.tid(X_2,"sys","functions"); - X_45 := algebra.likesubselect(X_6,X_3,A0,"":str,true); + X_45 := algebra.likesubselect(X_6,X_3,A0,"",true); (X_9,r1_9) := sql.bind(X_2,"sys","functions","name",2); - X_46 := algebra.likesubselect(r1_9,A0,"":str,true); + X_46 := algebra.likesubselect(r1_9,A0,"",true); X_12 := sql.bind(X_2,"sys","functions","name",1); - X_47 := algebra.likesubselect(X_12,X_3,A0,"":str,true); - X_14 := sql.subdelta(X_45,X_9,X_46,X_47); - X_16 := sql.projectdelta(X_14,X_6,X_9,r1_9,X_12); - X_17 := sql.bind(X_2,"sys","functions","func",0); - (X_19,r1_28) := sql.bind(X_2,"sys","functions","func",2); - X_21 := sql.bind(X_2,"sys","functions","func",1); - X_22 := sql.projectdelta(X_14,X_17,X_19,r1_28,X_21); - X_23 := sql.resultSet(2,1,X_16); - sql.rsColumn(X_23,"sys.functions","name","varchar",256,0,X_16); - sql.rsColumn(X_23,"sys.functions","func","varchar",8196,0,X_22); - X_32 := io.stdout(); - sql.exportResult(X_32,X_23); + X_47 := algebra.likesubselect(X_12,X_3,A0,"",true); + X_15 := sql.subdelta(X_45,X_9,X_46,X_47); + X_17 := sql.projectdelta(X_15,X_6,X_9,r1_9,X_12); + X_18 := sql.bind(X_2,"sys","functions","func",0); + (X_20,r1_28) := sql.bind(X_2,"sys","functions","func",2); + X_22 := sql.bind(X_2,"sys","functions","func",1); + X_23 := sql.projectdelta(X_15,X_18,X_20,r1_28,X_22); + X_24 := sql.resultSet(2,1,X_17); + sql.rsColumn(X_24,"sys.functions","name","varchar",256,0,X_17); + sql.rsColumn(X_24,"sys.functions","func","varchar",8196,0,X_23); + X_33 := io.stdout(); + sql.exportResult(X_33,X_24); end s1_1; #explain select name,func from functions where name ilike '%optimizers%'; % .explain # table_name @@ -86,22 +86,22 @@ function user.s2_1(A0:str):void; X_2 := sql.mvc(); X_6 := sql.bind(X_2,"sys","functions","name",0); X_3:bat[:oid,:oid] := sql.tid(X_2,"sys","functions"); - X_45 := algebra.ilikesubselect(X_6,X_3,A0,"":str,false); + X_45 := algebra.ilikesubselect(X_6,X_3,A0,"",false); (X_9,r1_9) := sql.bind(X_2,"sys","functions","name",2); - X_46 := algebra.ilikesubselect(r1_9,A0,"":str,false); + X_46 := algebra.ilikesubselect(r1_9,A0,"",false); X_12 := sql.bind(X_2,"sys","functions","name",1); - X_47 := algebra.ilikesubselect(X_12,X_3,A0,"":str,false); - X_14 := sql.subdelta(X_45,X_9,X_46,X_47); - X_16 := sql.projectdelta(X_14,X_6,X_9,r1_9,X_12); - X_17 := sql.bind(X_2,"sys","functions","func",0); - (X_19,r1_28) := sql.bind(X_2,"sys","functions","func",2); - X_21 := sql.bind(X_2,"sys","functions","func",1); - X_22 := sql.projectdelta(X_14,X_17,X_19,r1_28,X_21); - X_23 := sql.resultSet(2,1,X_16); - sql.rsColumn(X_23,"sys.functions","name","varchar",256,0,X_16); - sql.rsColumn(X_23,"sys.functions","func","varchar",8196,0,X_22); - X_32 := io.stdout(); - sql.exportResult(X_32,X_23); + X_47 := algebra.ilikesubselect(X_12,X_3,A0,"",false); + X_15 := sql.subdelta(X_45,X_9,X_46,X_47); + X_17 := sql.projectdelta(X_15,X_6,X_9,r1_9,X_12); + X_18 := sql.bind(X_2,"sys","functions","func",0); + (X_20,r1_28) := sql.bind(X_2,"sys","functions","func",2); + X_22 := sql.bind(X_2,"sys","functions","func",1); + X_23 := sql.projectdelta(X_15,X_18,X_20,r1_28,X_22); + X_24 := sql.resultSet(2,1,X_17); + sql.rsColumn(X_24,"sys.functions","name","varchar",256,0,X_17); + sql.rsColumn(X_24,"sys.functions","func","varchar",8196,0,X_23); + X_33 := io.stdout(); + sql.exportResult(X_33,X_24); end s2_1; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list
-- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
participants (1)
-
Stefan Manegold