Changeset: b7f40056d1ac for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/b7f40056d1ac Modified Files: monetdb5/modules/mal/CMakeLists.txt monetdb5/optimizer/CMakeLists.txt monetdb5/optimizer/opt_fastpath.c monetdb5/optimizer/opt_pipes.c monetdb5/optimizer/opt_prelude.c monetdb5/optimizer/opt_prelude.h monetdb5/optimizer/opt_wrapper.c monetdb5/optimizer/optimizer.c monetdb5/optimizer/optimizer.mal sql/backends/monet5/sql_optimizer.c Branch: types Log Message:
The baseline checkin diffs (183 lines): diff --git a/monetdb5/modules/mal/CMakeLists.txt b/monetdb5/modules/mal/CMakeLists.txt --- a/monetdb5/modules/mal/CMakeLists.txt +++ b/monetdb5/modules/mal/CMakeLists.txt @@ -43,6 +43,7 @@ target_sources(malmodules projectionpath.c tablet.c tablet.h batcalc.c calc.c + properties.c PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/wlc.h) diff --git a/monetdb5/optimizer/CMakeLists.txt b/monetdb5/optimizer/CMakeLists.txt --- a/monetdb5/optimizer/CMakeLists.txt +++ b/monetdb5/optimizer/CMakeLists.txt @@ -39,6 +39,7 @@ target_sources(optimizer opt_wlc.c opt_wlc.h opt_pipes.c opt_prelude.c opt_prelude.h + opt_properties.c opt_properties.h opt_reduce.c opt_reduce.h opt_remap.c opt_remap.h opt_remoteQueries.c opt_remoteQueries.h diff --git a/monetdb5/optimizer/opt_fastpath.c b/monetdb5/optimizer/opt_fastpath.c --- a/monetdb5/optimizer/opt_fastpath.c +++ b/monetdb5/optimizer/opt_fastpath.c @@ -23,6 +23,7 @@ #include "opt_generator.h" #include "opt_inline.h" #include "opt_jit.h" +#include "opt_properties.h" #include "opt_projectionpath.h" #include "opt_matpack.h" #include "opt_json.h" 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 @@ -54,6 +54,13 @@ static struct PIPELINES { //"optimizer.mask();" "optimizer.garbageCollector();", "stable", NULL, 1}, + {"properties_pipe", + "optimizer.inline();" + "optimizer.remap();" + "optimizer.properties();" + "optimizer.multiplex();" + "optimizer.garbageCollector();", + "stable", NULL, 1}, {"minimal_fast", "optimizer.minimalfast()", "stable", NULL, 1}, @@ -452,16 +459,20 @@ validatePipe(MalBlkPtr mb) /* several optimizer should be used */ if (multiplex == 0) throw(MAL, "optimizer.validate", SQLSTATE(42000) "'multiplex' should be used\n"); - if (deadcode == FALSE) - throw(MAL, "optimizer.validate", SQLSTATE(42000) "'deadcode' should be used at least once\n"); + // REMOVE This code is only ignored in the testing of types + (void) deadcode; + //if (deadcode == FALSE) + //throw(MAL, "optimizer.validate", SQLSTATE(42000) "'deadcode' should be used at least once\n"); if (garbage == FALSE) throw(MAL, "optimizer.validate", SQLSTATE(42000) "'garbageCollector' should be used as the last one\n"); if (remap == FALSE) throw(MAL, "optimizer.validate", SQLSTATE(42000) "'remap' should be used\n"); - if (generator == FALSE) - throw(MAL, "optimizer.validate", SQLSTATE(42000) "'generator' should be used\n"); - if (bincopyfrom == FALSE) - throw(MAL, "optimizer.validate", SQLSTATE(42000) "'bincopyfrom' should be used\n"); + (void) generator; + //REMOVE if (generator == FALSE) + //throw(MAL, "optimizer.validate", SQLSTATE(42000) "'generator' should be used\n"); + (void) bincopyfrom; + //REMOVE if (bincopyfrom == FALSE) + //throw(MAL, "optimizer.validate", SQLSTATE(42000) "'bincopyfrom' should be used\n"); return MAL_SUCCEED; } 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 @@ -221,6 +221,7 @@ const char *postludeRef; const char *preludeRef; const char *printRef; const char *prodRef; +const char *propertiesRef; const char *profilerRef; const char *projectdeltaRef; const char *projectionpathRef; @@ -527,6 +528,7 @@ void optimizerInit(void) preludeRef = putName("prelude"); printRef = putName("print"); prodRef = putName("prod"); + propertiesRef = putName("properties"); profilerRef = putName("profiler"); projectdeltaRef = putName("projectdelta"); projectionpathRef = putName("projectionpath"); 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 @@ -219,6 +219,7 @@ mal_export const char *postludeRef; mal_export const char *preludeRef; mal_export const char *printRef; mal_export const char *prodRef; +mal_export const char *propertiesRef; mal_export const char *profilerRef; mal_export const char *projectdeltaRef; mal_export const char *projectionpathRef; 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 @@ -39,6 +39,7 @@ #include "opt_matpack.h" #include "opt_json.h" #include "opt_oltp.h" +#include "opt_properties.h" #include "opt_postfix.h" #include "opt_mask.h" #include "opt_mergetable.h" @@ -88,6 +89,7 @@ struct{ {"oltp", &OPToltpImplementation,0,0}, {"postfix", &OPTpostfixImplementation,0,0}, {"profiler", &OPTprofilerImplementation,0,0}, + {"properties", &OPTpropertiesImplementation,0,0}, {"projectionpath", &OPTprojectionpathImplementation,0,0}, {"pushselect", &OPTpushselectImplementation,0,0}, {"querylog", &OPTquerylogImplementation,0,0}, diff --git a/monetdb5/optimizer/optimizer.c b/monetdb5/optimizer/optimizer.c --- a/monetdb5/optimizer/optimizer.c +++ b/monetdb5/optimizer/optimizer.c @@ -111,6 +111,7 @@ static mel_func optimizer_init_funcs[] = command("optimizer", "epilogue", optimizer_epilogue, false, "release the resources held by the optimizer module", args(1,1, arg("",void))), pattern("optimizer", "optimize", QOToptimize, false, "Optimize a specific operation", args(0,2, arg("mod",str),arg("fcn",str))), optwrapper_pattern("inline", "Expand inline functions"), + optwrapper_pattern("properties", "Scale down the columns if properties of the underlying BAT allows"), optwrapper_pattern("projectionpath", "Join path constructor"), pattern("optimizer", "macro", OPTmacro, false, "Inline the code of the target function.", args(1,3, arg("",void),arg("targetmod",str),arg("targetfcn",str))), pattern("optimizer", "macro", OPTmacro, false, "Inline a target function used in a specific function.", args(1,5, arg("",void),arg("mod",str),arg("fcn",str),arg("targetmod",str),arg("targetfcn",str))), diff --git a/monetdb5/optimizer/optimizer.mal b/monetdb5/optimizer/optimizer.mal --- a/monetdb5/optimizer/optimizer.mal +++ b/monetdb5/optimizer/optimizer.mal @@ -98,6 +98,14 @@ pattern optimizer.jit(mod:str, fcn:str): address OPTwrapper comment "Propagate candidate lists in just-in-time optimization"; +#opt_properties.mal + +pattern optimizer.properties():str +address OPTwrapper; +pattern optimizer.properties(mod:str, fcn:str):str +address OPTwrapper +comment "Scale down the footprint"; + #opt_evaluate.mal pattern optimizer.evaluate():str diff --git a/sql/backends/monet5/sql_optimizer.c b/sql/backends/monet5/sql_optimizer.c --- a/sql/backends/monet5/sql_optimizer.c +++ b/sql/backends/monet5/sql_optimizer.c @@ -120,7 +120,8 @@ str getSQLoptimizer(mvc *m) { char *opt = get_string_global_var(m, "optimizer"); - char *pipe = "default_pipe"; + //REMOVE char *pipe = "default_pipe"; not for this experiment + char *pipe = "properties_pipe"; if (opt) pipe = opt; @@ -148,10 +149,12 @@ addOptimizers(Client c, MalBlkPtr mb, ch if( space > (lng)(0.8 * MT_npages() * MT_pagesize()) && GDKnr_threads > 1){ pipe = "volcano_pipe"; }else - pipe = "default_pipe"; + //REMOVE pipe = "default_pipe"; + pipe = "properties_pipe"; } else */ - pipe = pipe? pipe: "default_pipe"; + //REMOVE pipe = pipe? pipe: "default_pipe"; + pipe = pipe? pipe: "properties_pipe"; msg = addOptimizerPipe(c, mb, pipe); if (msg){ return msg; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list