Changeset: 834286c68c3a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/834286c68c3a
Removed Files:
        monetdb5/optimizer/opt_volcano.c
        monetdb5/optimizer/opt_volcano.h
Modified Files:
        monetdb5/optimizer/CMakeLists.txt
        monetdb5/optimizer/opt_fastpath.c
        monetdb5/optimizer/opt_pipes.c
        monetdb5/optimizer/opt_wrapper.c
        monetdb5/optimizer/optimizer.c
        sql/backends/monet5/sql_optimizer.c
        sql/test/scoping/Tests/predefinedvariable.test
Branch: default
Log Message:

Removed unused (and unusable) volcano optimizer.


diffs (288 lines):

diff --git a/monetdb5/optimizer/CMakeLists.txt 
b/monetdb5/optimizer/CMakeLists.txt
--- a/monetdb5/optimizer/CMakeLists.txt
+++ b/monetdb5/optimizer/CMakeLists.txt
@@ -45,7 +45,6 @@ target_sources(optimizer
   opt_pushselect.c opt_pushselect.h
   opt_profiler.c opt_profiler.h
   opt_postfix.c opt_postfix.h
-  opt_volcano.c opt_volcano.h
   opt_fastpath.c opt_fastpath.h
   opt_wrapper.c
   PUBLIC
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
@@ -38,7 +38,6 @@
 #include "opt_remap.h"
 #include "opt_remoteQueries.h"
 #include "opt_reorder.h"
-#include "opt_volcano.h"
 #include "opt_fastpath.h"
 #include "optimizer_private.h"
 #include "mal_interpreter.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
@@ -105,43 +105,6 @@ static struct PIPELINES {
        {"default_fast",
         "optimizer.defaultfast()",
         "stable", NULL, 1},
-/* Apr2022 update. I disabled the volcano_pipe because it has issues on it */
-#if 0
-/*
- * Volcano style execution produces a sequence of blocks from the source 
relation
- */
-       {"volcano_pipe",
-        "optimizer.inline();"
-        "optimizer.remap();"
-        "optimizer.costModel();"
-        "optimizer.coercions();"
-        "optimizer.aliases();"
-        "optimizer.evaluate();"
-        "optimizer.emptybind();"
-        "optimizer.deadcode();" /* Feb2021 update, I pushed deadcode optimizer 
earlier in the pipeline so it runs before mitosis, thus removing less 
instructions */
-        "optimizer.pushselect();"
-        "optimizer.aliases();"
-        "optimizer.mitosis();"
-        "optimizer.mergetable();"
-        "optimizer.aliases();"
-        "optimizer.constants();"
-        "optimizer.commonTerms();"
-        "optimizer.projectionpath();"
-        "optimizer.deadcode();"
-        "optimizer.matpack();"
-        "optimizer.reorder();"
-        "optimizer.dataflow();"
-        "optimizer.querylog();"
-        "optimizer.multiplex();"
-        "optimizer.generator();"
-        "optimizer.volcano();"
-        "optimizer.candidates();"
-        "optimizer.deadcode();"
-        "optimizer.postfix();"
-        "optimizer.garbageCollector();"
-        "optimizer.profiler();",
-        "stable", NULL, 1},
-#endif
 /* The no_mitosis pipe line is (and should be kept!) identical to the
  * default pipeline, except that optimizer mitosis is omitted.  It is
  * used mainly to make some tests work deterministically, and to check
diff --git a/monetdb5/optimizer/opt_volcano.c b/monetdb5/optimizer/opt_volcano.c
deleted file mode 100644
--- a/monetdb5/optimizer/opt_volcano.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0.  If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * Copyright 1997 - July 2008 CWI, August 2008 - 2023 MonetDB B.V.
- */
-
-/*
- * Selectively inject serialization operations when we know the
- * raw footprint of the query exceeds 80% of RAM.
- */
-
-#include "monetdb_config.h"
-#include "mal_instruction.h"
-#include "opt_volcano.h"
-
-// delaying the startup should not be continued throughout the plan
-// after the startup phase there should be intermediate work to do
-//A heuristic to check it
-#define MAXdelays 128
-
-str
-OPTvolcanoImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci)
-{
-       int i, limit, actions = 0;
-       int mvcvar = -1;
-       int count=0;
-       InstrPtr p,q, *old = NULL;
-       str msg = MAL_SUCCEED;
-
-       (void) cntxt;
-       (void) stk;             /* to fool compilers */
-
-       if ( mb->inlineProp )
-               goto wrapup;
-
-       old = mb->stmt;
-       limit= mb->stop;
-       if ( newMalBlkStmt(mb, mb->ssize + 20) < 0)
-               throw(MAL,"optimizer.volcano", SQLSTATE(HY013) MAL_MALLOC_FAIL);
-
-       actions = 1;
-       for (i = 0; i < limit; i++) {
-               p = old[i];
-
-               pushInstruction(mb,p);
-               if( getModuleId(p) == sqlRef && getFunctionId(p)== mvcRef ){
-                       mvcvar = getArg(p,0);
-                       continue;
-               }
-
-               if( count < MAXdelays && getModuleId(p) == algebraRef ){
-                       if( getFunctionId(p) == selectRef ||
-                               getFunctionId(p) == thetaselectRef ||
-                               getFunctionId(p) == likeselectRef ||
-                               getFunctionId(p) == joinRef
-                       ){
-                               q= newInstruction(0,languageRef,blockRef);
-                               if (q == NULL) {
-                                       msg = createException(MAL, 
"optimizer.volcano", SQLSTATE(HY013) MAL_MALLOC_FAIL);
-                                       break;
-                               }
-                               setDestVar(q, newTmpVariable(mb,TYPE_any));
-                               q =  pushArgument(mb,q,mvcvar);
-                               q =  pushArgument(mb,q,getArg(p,0));
-                               mvcvar=  getArg(q,0);
-                               pushInstruction(mb,q);
-                               count++;
-                       }
-                       continue;
-               }
-               if( count < MAXdelays && getModuleId(p) == groupRef ){
-                       if( getFunctionId(p) == subgroupdoneRef || 
getFunctionId(p) == groupdoneRef ){
-                               q= newInstruction(0,languageRef,blockRef);
-                               if (q == NULL) {
-                                       msg = createException(MAL, 
"optimizer.volcano", SQLSTATE(HY013) MAL_MALLOC_FAIL);
-                                       break;
-                               }
-                               setDestVar(q, newTmpVariable(mb,TYPE_any));
-                               q =  pushArgument(mb,q,mvcvar);
-                               q =  pushArgument(mb,q,getArg(p,0));
-                               mvcvar=  getArg(q,0);
-                               pushInstruction(mb,q);
-                               count++;
-                       }
-               }
-               if( getModuleId(p) == sqlRef){
-                       if ( getFunctionId(p) == bindRef ||
-                               getFunctionId(p) == bindidxRef ||
-                               getFunctionId(p) == tidRef ||
-                               getFunctionId(p) == appendRef ||
-                               getFunctionId(p) == updateRef ||
-                               getFunctionId(p) == claimRef ||
-                               getFunctionId(p) == dependRef ||
-                               getFunctionId(p) == predicateRef ||
-                               getFunctionId(p) == deleteRef
-                       ){
-                               setArg(p,p->retc,mvcvar);
-                       }
-               }
-       }
-       GDKfree(old);
-
-       /* Defense line against incorrect plans */
-       if( msg == MAL_SUCCEED && count){
-               msg = chkTypes(cntxt->usermodule, mb, FALSE);
-               if (!msg)
-                       msg = chkFlow(mb);
-               if (!msg)
-                       msg = chkDeclarations(mb);
-       }
-wrapup:
-       /* keep actions taken as a fake argument*/
-       (void) pushInt(mb, pci, actions);
-       return msg;
-}
diff --git a/monetdb5/optimizer/opt_volcano.h b/monetdb5/optimizer/opt_volcano.h
deleted file mode 100644
--- a/monetdb5/optimizer/opt_volcano.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0.  If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * Copyright 1997 - July 2008 CWI, August 2008 - 2023 MonetDB B.V.
- */
-
-#ifndef _OPT_VOLCANO_
-#define _OPT_VOLCANO_
-#include "opt_prelude.h"
-#include "opt_support.h"
-#include "mal_exception.h"
-
-extern str OPTvolcanoImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr p);
-
-#endif
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
@@ -50,7 +50,6 @@
 #include "opt_remap.h"
 #include "opt_remoteQueries.h"
 #include "opt_reorder.h"
-#include "opt_volcano.h"
 #include "opt_fastpath.h"
 #include "optimizer_private.h"
 
@@ -91,7 +90,6 @@ static struct {
        {"remap", &OPTremapImplementation,0,0},
        {"remoteQueries", &OPTremoteQueriesImplementation,0,0},
        {"reorder", &OPTreorderImplementation,0,0},
-       {"volcano", &OPTvolcanoImplementation,0,0},
        {0,0,0,0}
 };
 static int codehash[256];
diff --git a/monetdb5/optimizer/optimizer.c b/monetdb5/optimizer/optimizer.c
--- a/monetdb5/optimizer/optimizer.c
+++ b/monetdb5/optimizer/optimizer.c
@@ -90,7 +90,6 @@ static mel_func optimizer_init_funcs[] =
  optwrapper_pattern("coercions", "Handle simple type coercions"),
  optwrapper_pattern("commonTerms", "Common sub-expression optimizer"),
  optwrapper_pattern("candidates", "Mark candidate list variables"),
- /* optwrapper_pattern("volcano", "Simulate volcano style execution"), Apr2022 
update. I disabled the volcano_pipe because it has issues on it */
  optwrapper_pattern("constants", "Duplicate constant removal optimizer"),
  optwrapper_pattern("profiler", "Collect properties for the profiler"),
  optwrapper_pattern("costModel", "Estimate the cost of a relational 
expression"),
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
@@ -140,18 +140,6 @@ addOptimizers(Client c, MalBlkPtr mb, ch
        assert(be && be->mvc);  /* SQL clients should always have their state 
set */
 
        (void) SQLgetSpace(be->mvc, mb, prepare); // detect empty bats.
-       /* The volcano optimizer seems relevant for traditional HDD settings.
-        * It produced about 8 % improvement onf TPCH SF 100 on a 16G machine.
-        * In a SSD setting it was counter productive, leading to worse 
parallel behavior.
-        * The automatic switch to volcano is now disabled assuming more use of 
SSD.
-        * The volcano optimizer pipeline can be used instead
-       if(space && (pipe == NULL || strcmp(pipe,"default_pipe")== 0)){
-               if( space > (lng)(0.8 * MT_npages() * MT_pagesize())  && 
GDKnr_threads > 1){
-                       pipe = "volcano_pipe";
-               }else
-                       pipe = "default_pipe";
-       } else
-       */
        pipe = pipe? pipe: "default_pipe";
        msg = addOptimizerPipe(c, mb, pipe);
        if (msg){
diff --git a/sql/test/scoping/Tests/predefinedvariable.test 
b/sql/test/scoping/Tests/predefinedvariable.test
--- a/sql/test/scoping/Tests/predefinedvariable.test
+++ b/sql/test/scoping/Tests/predefinedvariable.test
@@ -67,13 +67,13 @@ end
 statement ok
 create procedure poo()
 begin
-       set optimizer='volcano_pipe';
+       set optimizer='sequential_pipe';
 end
 
 statement ok
 create procedure poo2()
 begin
-       set sys.optimizer='volcano_pipe';
+       set sys.optimizer='sequential_pipe';
 end
 
 statement error
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to