[Monetdb-developers] MonetDB: default - test opt_sql_append: trying to upgrade to new...

Stefan Manegold Stefan.Manegold at cwi.nl
Sat Feb 18 19:12:01 CET 2012


How can I (if at all) use/add a new optimizer (in SQL) without defining a
new pipe (in C code)?

Thanks,
Stefan

On Sat, Feb 18, 2012 at 06:37:44PM +0100, Martin Kersten wrote:
> The new optimizer infrastructure returns the name of the pipe, not its 
> content. The definitions can be obtained from the system view:
> 
> select * from optimizers();
> 
> can be used to get the expanded form.
> 
> On 2/18/12 6:11 PM, Stefan Manegold wrote:
> > Changeset: 62a52aaf4241 for MonetDB
> > URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=62a52aaf4241
> > Modified Files:
> > 	monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.sql
> > 	monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out
> > Branch: default
> > Log Message:
> >
> > test opt_sql_append: trying to upgrade to new optimizer framework
> >
> > However, setting SQL variable "optimizer" to a MAL snippert
> > rather than an optimizer pipeline name does not seem to work (yet?) ...
> >
> >
> > diffs (39 lines):
> >
> > diff --git a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.sql b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.sql
> > --- a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.sql
> > +++ b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.sql
> > @@ -1,7 +1,9 @@
> >   create table ttt (a int, b int, c int);
> >   select optimizer;
> >   explain copy into ttt from '/tmp/xyz';
> > -set optimizer = substring(optimizer,0,length(optimizer)-length('garbageCollector')) || 'sql_append,garbageCollector';
> > +declare opt_pipe_name string; set opt_pipe_name = ( select optimizer );
> > +declare opt_pipe_def  string; set opt_pipe_def  = ( select def from optimizers() where name = opt_pipe_name );
> > +set optimizer = substring(opt_pipe_def,0,length(opt_pipe_def)-length('optimizer.garbageCollector();')) || 'optimizer.sql_append();optimizer.garbageCollector();';
> >   select optimizer;
> >   explain copy into ttt from '/tmp/xyz';
> >   drop table ttt;
> > 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
> > @@ -49,8 +49,8 @@ Ready.
> >   % . # table_name
> >   % single_value # name
> >   % varchar # type
> > -% 188 # length
> > -[ "inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,accumulators,garbageCollector"	]
> > +% 12 # length
> > +[ "default_pipe"	]
> >   #explain copy into ttt from '/tmp/xyz';
> >   % .explain # table_name
> >   % mal # name
> > @@ -69,8 +69,8 @@ end s2_1;
> >   % . # table_name
> >   % single_value # name
> >   % varchar # type
> > -% 199 # length
> > -[ "inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,accumulators,sql_append,garbageCollector"	]
> > +% 452 # length
> > +[ "optimizer.inline();optimizer.remap();optimizer.evaluate();optimizer.costModel();optimizer.coercions();optimizer.emptySet();optimizer.aliases();optimizer.mitosis();optimizer.mergetable();optimizer.deadcode();optimizer.commonTerms();optimizer.joinPath();optimizer.reorder();optimizer.deadcode();optimizer.reduce();optimizer.dataflow();optimizer.history();optimizer.multiplex();optimizer.accumulators();optimizer.sql_append();optimizer.garbageCollector();"	]
> >   #explain copy into ttt from '/tmp/xyz';
> >   % .explain # table_name
> >   % mal # name
> > _______________________________________________
> > Checkin-list mailing list
> > Checkin-list at monetdb.org
> > http://mail.monetdb.org/mailman/listinfo/checkin-list
> 
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing 
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Monetdb-developers mailing list
> Monetdb-developers at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-developers
> 

-- 
| Stefan.Manegold @ CWI.nl | DB Architectures (INS1) |
| http://CWI.nl/~manegold/ | Science Park 123 (L321) |
| Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam  (NL) |




More information about the developers-list mailing list