Changeset: 1218c4cf758f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1218c4cf758f
Modified Files:
        monetdb5/extras/jaql/jaqlscenario.c
Branch: Feb2013
Log Message:

jaql: run optimiser framework

Run the optimisers on JAQL generated code.  Currently hardcoded to use
minimal_pipe.  We can't use default_pipe, because joinPath optimiser
produces incorrect MAL.  All in all, this commit does nothing but add
some extra delay in processing queries due to running the optimiser
stack.  We hope for getting the joinPath optimiser fixed, of course.


diffs (37 lines):

diff --git a/monetdb5/extras/jaql/jaqlscenario.c 
b/monetdb5/extras/jaql/jaqlscenario.c
--- a/monetdb5/extras/jaql/jaqlscenario.c
+++ b/monetdb5/extras/jaql/jaqlscenario.c
@@ -28,6 +28,7 @@
 #include "mal_scenario.h"
 #include "mal_instruction.h"
 #include "optimizer.h"
+#include "opt_pipes.h"
 
 extern int jaqlparse(jc *j);
 extern int jaqllex_init_extra(jc *user_defined, void **scanner);
@@ -241,6 +242,16 @@ JAQLparser(Client c)
 
                j->timing.optimise = GDKusec();
                chkTypes(out, c->nspace, prg->def, FALSE);
+               /* TODO: use a configured pipe */
+               addOptimizerPipe(c, prg->def, "minimal_pipe");
+               if ((errmsg = optimizeMALBlock(c, prg->def)) != MAL_SUCCEED) {
+                       MSresetInstructions(prg->def, oldstop);
+                       freeVariables(c, prg->def, c->glb, oldvtop);
+                       prg->def->errors = 0;
+                       mnstr_printf(out, "!%s\n", errmsg);
+                       freetree(j->p);
+                       return errmsg;
+               }
                j->timing.optimise = GDKusec() - j->timing.optimise;
                if (prg->def->errors) {
                        /* this is bad already, so let's try to make it 
debuggable */
@@ -271,7 +282,7 @@ JAQLengine(Client c)
 
        /* FIXME: if we don't run this, any barrier will cause an endless loop
         * (program jumps back to first frame), so this is kind of a
-        * workaround that maybe can go once we run the optimiser stack */
+        * workaround */
        chkProgram(c->fdout, c->nspace, c->curprg->def);
 
        c->glb = 0;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to