Changeset: 9b6180c5169c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9b6180c5169c
Branch: reducedstack
Log Message:
merged with default
diffs (truncated from 650 to 300 lines):
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -899,6 +899,7 @@ const char dblRef[];
void debugFunction(stream *fd, MalBlkPtr mb, MalStkPtr stk, int flg, int
first, int size);
const char decompressRef[];
int defConstant(MalBlkPtr mb, int type, ValPtr cst);
+const char defaultfastRef[];
const char defineRef[];
void delArgument(InstrPtr p, int varid);
const char deleteRef[];
@@ -1427,13 +1428,6 @@ char *UDFfuse_int_lng(lng *ret, const in
char *UDFfuse_lng_hge(hge *ret, const lng *one, const lng *two);
char *UDFfuse_sht_int(int *ret, const sht *one, const sht *two);
str UDFreverse(str *ret, const str *arg);
-str VLTgenerator_join(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
-str VLTgenerator_noop(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
-str VLTgenerator_projection(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
InstrPtr pci);
-str VLTgenerator_rangejoin(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr
pci);
-str VLTgenerator_subselect(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr
pci);
-str VLTgenerator_table(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr
pci);
-str VLTgenerator_thetasubselect(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
InstrPtr pci);
str append_to_table_from_emit(Client cntxt, char *sname, char *tname,
sql_emit_col *columns, size_t ncols);
str batbte_dec2_bte(bat *res, const int *s1, const bat *v, const bat *sid);
str batbte_dec2_dbl(bat *res, const int *s1, const bat *v, const bat *sid);
diff --git a/clients/odbc/tests/ODBCmetadata.c
b/clients/odbc/tests/ODBCmetadata.c
--- a/clients/odbc/tests/ODBCmetadata.c
+++ b/clients/odbc/tests/ODBCmetadata.c
@@ -1535,7 +1535,7 @@ main(int argc, char **argv)
compareResult(stmt, ret, "EXPLAIN SELECT * from odbctst.\"LINES\"",
nrServerThreads > 1 ?
"Resultset with 1 columns\n"
- "Resultset with 46 rows\n"
+ "Resultset with 17 rows\n"
"mal\n"
"WLONGVARCHAR(174)\n"
"function user.main():void;\n"
@@ -1553,13 +1553,10 @@ main(int argc, char **argv)
"\n"
" X_37:int := sql.resultSet(X_38:bat[:str], X_39:bat[:str],
X_40:bat[:str], X_41:bat[:int], X_42:bat[:int], X_33:bat[:int], X_34:bat[:int],
X_35:bat[:int], X_36:bat[:int]);\n"
"end user.main;\n"
- "\n\n\n\n\n\n\n\n\n\n"
- "\n\n\n\n\n\n\n\n\n\n"
- "\n\n\n\n\n\n\n\n\n\n"
- "\n"
+ "\n\n"
:
"Resultset with 1 columns\n"
- "Resultset with 44 rows\n"
+ "Resultset with 15 rows\n"
"mal\n"
"WLONGVARCHAR(174)\n"
"function user.main():void;\n"
@@ -1575,10 +1572,7 @@ main(int argc, char **argv)
" X_42:bat[:int] := bat.pack(0:int, 0:int, 0:int, 3:int);\n"
" X_37:int := sql.resultSet(X_38:bat[:str], X_39:bat[:str],
X_40:bat[:str], X_41:bat[:int], X_42:bat[:int], X_33:bat[:int], X_34:bat[:int],
X_35:bat[:int], X_36:bat[:int]);\n"
"end user.main;\n"
- "\n\n\n\n\n\n\n\n\n\n"
- "\n\n\n\n\n\n\n\n\n\n"
- "\n\n\n\n\n\n\n\n\n\n"
- "\n");
+ "\n\n");
// test TRACE SELECT query.
// This will return two resultsets: first with the query results and
next with the trace results
diff --git a/monetdb5/mal/mal_client.c b/monetdb5/mal/mal_client.c
--- a/monetdb5/mal/mal_client.c
+++ b/monetdb5/mal/mal_client.c
@@ -276,7 +276,7 @@ MCinitClientRecord(Client c, oid user, b
c->profticks = c->profstmt = c->profevents = NULL;
c->error_row = c->error_fld = c->error_msg = c->error_input = NULL;
- c->sqlprofiler = 0;
+ c->sqlprofiler = false;
c->blocksize = BLOCK;
c->protocol = PROTOCOL_9;
@@ -442,7 +442,7 @@ MCcloseClient(Client c)
BBPunfix(c->error_input->batCacheid);
c->error_row = c->error_fld = c->error_msg = c->error_input =
NULL;
}
- c->sqlprofiler = 0;
+ c->sqlprofiler = false;
free(c->handshake_options);
c->handshake_options = NULL;
MT_thread_set_qry_ctx(NULL);
diff --git a/monetdb5/mal/mal_client.h b/monetdb5/mal/mal_client.h
--- a/monetdb5/mal/mal_client.h
+++ b/monetdb5/mal/mal_client.h
@@ -68,7 +68,8 @@ typedef struct CLIENT {
init_client initClient;
exit_client exitClient;
/* if set to 'S' it will put the process to sleep */
- bit sqlprofiler; /* control off-line sql
performance monitoring */
+ bool sqlprofiler; /* control off-line sql
performance monitoring */
+ bool no_mitosis; /* don't use mitosis optimizer
*/
/*
* Each session comes with resource limitations and predefined settings.
*/
diff --git a/monetdb5/mal/mal_namespace.c b/monetdb5/mal/mal_namespace.c
--- a/monetdb5/mal/mal_namespace.c
+++ b/monetdb5/mal/mal_namespace.c
@@ -152,6 +152,7 @@ const char cume_distRef[] = "cume_dist";
const char dataflowRef[] = "dataflow";
const char dblRef[] = "dbl";
const char decompressRef[] = "decompress";
+const char defaultfastRef[] = "defaultfast";
const char defineRef[] = "define";
const char deleteRef[] = "delete";
const char deltaRef[] = "delta";
@@ -418,6 +419,7 @@ initNamespace(void)
fixName(dataflowRef);
fixName(dblRef);
fixName(decompressRef);
+ fixName(defaultfastRef);
fixName(defineRef);
fixName(deleteRef);
fixName(deltaRef);
diff --git a/monetdb5/mal/mal_namespace.h b/monetdb5/mal/mal_namespace.h
--- a/monetdb5/mal/mal_namespace.h
+++ b/monetdb5/mal/mal_namespace.h
@@ -77,6 +77,7 @@ mal_export const char cume_distRef[];
mal_export const char dataflowRef[];
mal_export const char dblRef[];
mal_export const char decompressRef[];
+mal_export const char defaultfastRef[];
mal_export const char defineRef[];
mal_export const char deleteRef[];
mal_export const char deltaRef[];
diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -795,7 +795,7 @@ startProfiler(Client cntxt)
str
startTrace(Client cntxt)
{
- cntxt->sqlprofiler = TRUE;
+ cntxt->sqlprofiler = true;
clearTrace(cntxt);
return MAL_SUCCEED;
}
@@ -803,7 +803,7 @@ startTrace(Client cntxt)
str
stopTrace(Client cntxt)
{
- cntxt->sqlprofiler = FALSE;
+ cntxt->sqlprofiler = false;
return MAL_SUCCEED;
}
@@ -965,7 +965,7 @@ sqlProfilerEvent(Client cntxt, MalBlkPtr
false) != GDK_SUCCEED;
if (errors > 0) {
/* stop profiling if an error occurred */
- cntxt->sqlprofiler = FALSE;
+ cntxt->sqlprofiler = false;
}
MT_lock_unset(&mal_profileLock);
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
@@ -44,14 +44,12 @@
#include "optimizer_private.h"
#include "mal_interpreter.h"
-#define optcall(TEST, OPT)
\
+#define optcall(OPT)
\
do {
\
- if (TEST) {
\
- if ((msg = OPT(cntxt, mb, stk, pci)) != MAL_SUCCEED)
\
- goto bailout;
\
- actions += *(int*)getVarValue(mb, getArg(pci, pci->argc
- 1)); \
- delArgument(pci, pci->argc - 1); /* keep number of argc
low, so 'pci' is not reallocated */ \
- }
\
+ if ((msg = OPT(cntxt, mb, stk, pci)) != MAL_SUCCEED)
\
+ goto bailout;
\
+ actions += *(int*)getVarValue(mb, getArg(pci, pci->argc - 1));
\
+ delArgument(pci, pci->argc - 1); /* keep number of argc low, so
'pci' is not reallocated */ \
} while (0)
str
@@ -59,28 +57,37 @@ OPTminimalfastImplementation(Client cntx
InstrPtr pci)
{
str msg = MAL_SUCCEED;
- int generator = 0, multiplex = 0, actions = 0;
+ bool generator = false, multiplex = true;
+ int actions = 0;
/* perform a single scan through the plan to determine which optimizer
steps to skip */
for (int i = 0; i < mb->stop; i++) {
InstrPtr q = getInstrPtr(mb, i);
- if (getModuleId(q) == generatorRef)
- generator = 1;
- if (getFunctionId(q) == multiplexRef)
- multiplex = 1;
+ if (getModuleId(q) == generatorRef) {
+ generator = true;
+ if (multiplex)
+ break;
+ }
+ if (getFunctionId(q) == multiplexRef) {
+ multiplex = true;
+ if (generator)
+ break;
+ }
}
- optcall(true, OPTinlineImplementation);
- optcall(true, OPTremapImplementation);
- optcall(true, OPTemptybindImplementation);
- optcall(true, OPTdeadcodeImplementation);
- optcall(true, OPTforImplementation);
- optcall(true, OPTdictImplementation);
- optcall(multiplex, OPTmultiplexImplementation);
- optcall(generator, OPTgeneratorImplementation);
- optcall(profilerStatus, OPTprofilerImplementation);
- optcall(profilerStatus, OPTcandidatesImplementation);
- optcall(true, OPTgarbageCollectorImplementation);
+ optcall(OPTinlineImplementation);
+ optcall(OPTremapImplementation);
+ optcall(OPTemptybindImplementation);
+ optcall(OPTdeadcodeImplementation);
+ optcall(OPTforImplementation);
+ optcall(OPTdictImplementation);
+ if (multiplex)
+ optcall(OPTmultiplexImplementation);
+ if (generator)
+ optcall(OPTgeneratorImplementation);
+ if (profilerStatus)
+ optcall(OPTprofilerImplementation);
+ optcall(OPTgarbageCollectorImplementation);
/* Defense line against incorrect plans handled by optimizer steps */
/* keep actions taken as a fake argument */
@@ -94,47 +101,62 @@ OPTdefaultfastImplementation(Client cntx
InstrPtr pci)
{
str msg = MAL_SUCCEED;
- int generator = 0, multiplex = 0, actions = 0;
+ bool generator = false, multiplex = false;
+ int actions = 0;
/* perform a single scan through the plan to determine which optimizer
steps to skip */
for (int i = 0; i < mb->stop; i++) {
InstrPtr q = getInstrPtr(mb, i);
- if (getModuleId(q) == generatorRef)
- generator = 1;
- if (getFunctionId(q) == multiplexRef)
- multiplex = 1;
+ if (getModuleId(q) == generatorRef) {
+ generator = true;
+ if (multiplex)
+ break;
+ }
+ if (getFunctionId(q) == multiplexRef) {
+ multiplex = true;
+ if (generator)
+ break;
+ }
}
- optcall(true, OPTinlineImplementation);
- optcall(true, OPTremapImplementation);
- optcall(true, OPTcostModelImplementation);
- optcall(true, OPTcoercionImplementation);
- optcall(true, OPTaliasesImplementation);
- optcall(true, OPTevaluateImplementation);
- optcall(true, OPTemptybindImplementation);
- optcall(true, OPTdeadcodeImplementation);
- optcall(true, OPTpushselectImplementation);
- optcall(true, OPTaliasesImplementation);
- optcall(true, OPTforImplementation);
- optcall(true, OPTdictImplementation);
- optcall(true, OPTmitosisImplementation);
- optcall(true, OPTmergetableImplementation);
- optcall(true, OPTaliasesImplementation);
- optcall(true, OPTconstantsImplementation);
- optcall(true, OPTcommonTermsImplementation);
- optcall(true, OPTprojectionpathImplementation);
- optcall(true, OPTdeadcodeImplementation);
- optcall(true, OPTreorderImplementation);
- optcall(true, OPTmatpackImplementation);
- optcall(true, OPTdataflowImplementation);
- optcall(true, OPTquerylogImplementation);
- optcall(multiplex, OPTmultiplexImplementation);
- optcall(generator, OPTgeneratorImplementation);
- optcall(profilerStatus, OPTprofilerImplementation);
- optcall(profilerStatus, OPTcandidatesImplementation);
- optcall(true, OPTdeadcodeImplementation);
- optcall(true, OPTpostfixImplementation);
- optcall(true, OPTgarbageCollectorImplementation);
+ optcall(OPTinlineImplementation);
+ optcall(OPTremapImplementation);
+ optcall(OPTcostModelImplementation);
+ optcall(OPTcoercionImplementation);
+ optcall(OPTaliasesImplementation);
+ optcall(OPTevaluateImplementation);
+ optcall(OPTemptybindImplementation);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]