MonetDB: ascii-flag - Initialize variables.
Changeset: 1b913eb06824 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/1b913eb06824 Modified Files: gdk/gdk_string.c Branch: ascii-flag Log Message: Initialize variables. diffs (11 lines): diff --git a/gdk/gdk_string.c b/gdk/gdk_string.c --- a/gdk/gdk_string.c +++ b/gdk/gdk_string.c @@ -6870,6 +6870,7 @@ GDKstrncasecmp(const char *str1, const c if (x2 == NULL && *s2 == 0) return 1; + v1 = v2 = 0; /* get next character from str1 */ if (x1 == NULL) { v1 = casefold[*s1++]; ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: ascii-flag - We only need to initialize once + clarify ...
Changeset: 912ad6ae2632 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/912ad6ae2632 Modified Files: gdk/gdk_string.c Branch: ascii-flag Log Message: We only need to initialize once + clarify comment. diffs (57 lines): diff --git a/gdk/gdk_string.c b/gdk/gdk_string.c --- a/gdk/gdk_string.c +++ b/gdk/gdk_string.c @@ -6859,7 +6859,7 @@ GDKstrncasecmp(const char *str1, const c const uint8_t *s2 = (const uint8_t *) str2; const uint8_t *x1 = NULL, *x2 = NULL; int n1, n2; - int v1, v2; + int v1 = 0, v2 = 0; for (;;) { /* check for the end */ @@ -6870,7 +6870,6 @@ GDKstrncasecmp(const char *str1, const c if (x2 == NULL && *s2 == 0) return 1; - v1 = v2 = 0; /* get next character from str1 */ if (x1 == NULL) { v1 = casefold[*s1++]; @@ -6929,19 +6928,23 @@ GDKstrncasecmp(const char *str1, const c n2++; } - /* At this point, if x1 != NULL (then v1 == 0), it -* points to the end of a sequence of length n1 that is -* (part of) the first string to be compared and if *x1 -* != 0, it points to the next character to be compared -* (in the next iteration, else we continue with s1); -* else if v1 == 0, s1 points to the end of a sequence -* of length n1 that is (part of) the string to be -* compared; else v1 is the codepoint to be compared. -* In any case, s1 points to the start of the next -* character to be compared (after x1 is exhausted). -* The value in l1 is the remaining length of the first -* string (i.e. what s1 points to). The same for x2, -* s2, n2, l2, and v2. */ + /* At this point, there are three possibilities: +* x1 != NULL && v1 == 0: +* x1 points to the byte behind a UTF-8 sequence of +* length n1 that is to be compared (so x1-n1 is the +* start); +* x1 == NULL && v1 == 0: +* s1 points to the byte behind a UTF-8 sequence of +* length n1 that is to be compared (so s1-n1 is the +* start); +* x1 == NULL && v1 != 0: +* v1 is the codepoint value that is to be compared. +* Note that x1 != NULL && v1 != 0 cannot happen. +* In all cases, s1 points to the start of the next +* UTF-8 sequence, and l1 is the number of bytes left +* that are to be compared (can be zero). +* +* The same goes for s2/x2/v2/n2/l2. */ /* compare */ if (v1 == 0) { ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - implemented group by and order by reference n...
Changeset: 2c2bfc484616 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/2c2bfc484616 Added Files: sql/test/miscellaneous/Tests/group_by_all.test sql/test/sets/Tests/All sql/test/sets/Tests/union.test Modified Files: sql/include/sql_relation.h sql/rel.txt sql/server/rel_exp.c sql/server/rel_exp.h sql/server/rel_rel.c sql/server/rel_select.c sql/server/rel_unnest.c sql/server/sql_parser.y sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.test sql/test/BugTracker-2024/Tests/aggr-exp-copy-crash-7435.test sql/test/SQLancer/Tests/sqlancer01.test sql/test/SQLancer/Tests/sqlancer03.test sql/test/SQLancer/Tests/sqlancer08.test sql/test/SQLancer/Tests/sqlancer09.test sql/test/SQLancer/Tests/sqlancer10.test sql/test/SQLancer/Tests/sqlancer14.test sql/test/SQLancer/Tests/sqlancer15.test sql/test/SQLancer/Tests/sqlancer23.test sql/test/miscellaneous/Tests/All sql/test/miscellaneous/Tests/groupby_expressions.test sql/test/miscellaneous/Tests/simple_selects.test sql/test/subquery/Tests/subquery3.test sql/test/subquery/Tests/subquery6.test Branch: default Log Message: implemented group by and order by reference number corrected handling of constants in group by (ie we now disallow this as defined by sql standard) add support for group by and order by all/* diffs (truncated from 1011 to 300 lines): diff --git a/sql/include/sql_relation.h b/sql/include/sql_relation.h --- a/sql/include/sql_relation.h +++ b/sql/include/sql_relation.h @@ -50,7 +50,7 @@ typedef struct expression { unsigned short tmp; unsigned int card:2,/* card (0 truth value!) (1 atoms) (2 aggr) (3 multi value) */ -freevar:4, /* free variable, ie binds to the upper dependent join */ +freevar:8, /* free variable, ie binds to the upper dependent join */ intern:1, selfref:1, /* set when the expression references a expression in the same projection list */ anti:1, @@ -298,7 +298,7 @@ typedef struct relation { int nrcols; /* nr of cols */ unsigned int flag:16, -card:4,/* 0, 1 (row), 2 aggr, 3 */ +card:2,/* 0, 1 (row), 2 aggr, 3 */ dependent:1, /* dependent join */ distinct:1, processed:1, /* fully processed or still in the process of building */ diff --git a/sql/rel.txt b/sql/rel.txt --- a/sql/rel.txt +++ b/sql/rel.txt @@ -66,6 +66,7 @@ GROUPBY (card ATOM (no group by exps), -> exps is list of (groupby and) aggregate expressions -> lis relation -> ris list of group by expressions + -> flag 1 has group by nr , 2 group by all TOPN (card ATOM, AGGR, or MULTI (same card as lower relation)) -> exps (list) lng limit, [ lng offset ] -> if the limit is a NULL value, then it's ignored, ie only the offset will be used diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -2058,6 +2058,99 @@ exp_is_atom( sql_exp *e ) return 0; } +static int +exps_are_aggr(sql_rel *r, list *exps) +{ + int aggr = 1; + if (!list_empty(exps)) + for(node *n=exps->h; n && aggr; n=n->next) + aggr &= exp_is_aggr(r, n->data); + return aggr; +} + +/* is expression e an aggregated result of r */ +int +exp_is_aggr(sql_rel *r, sql_exp *e) +{ + sql_exp *ne = NULL; + + switch (e->type) { + case e_atom: + return true; + case e_convert: + return exp_is_aggr(r, e->l); + case e_func: + return exps_are_aggr(r, e->l); + case e_aggr: + return true; + case e_cmp: + if (e->card != CARD_ATOM) + return false; + if (e->flag == cmp_or || e->flag == cmp_filter) + return exps_are_aggr(r, e->l) && exps_are_aggr(r, e->r); + if (e->flag == cmp_in || e->flag == cmp_notin) + return exp_is_aggr(r, e->l) && exps_are_aggr(r, e->r); + return exp_is_aggr(r, e->l) && exp_is_aggr(r, e->r) && (!e->f || exp_is_aggr(r, e->f)); + case e_column: + if (e->freevar) + return true; + ne = rel_find_exp(r, e); + if (ne) /* found local */ + return true; + else + return false; + case e_psm: + return false; + } + return false; +} + +static int +exps_have_aggr(sql_rel *r, list *exps) +{ + int aggr = 0; + if (!list_empty(exps)) + for(node *n=exps->h; n && !aggr; n=n->next) + aggr |= exp_has_aggr(r, n->d
MonetDB: default - added changelog for group by/order by changes
Changeset: e21380596aa6 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/e21380596aa6 Modified Files: ChangeLog Branch: default Log Message: added changelog for group by/order by changes diffs (14 lines): diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ # ChangeLog file for devel # This file is updated with Maddlog +* Wed May 8 2024 Niels Nes +- Add support for select exp, count(*) group by 1 order by 1; ie. using + numeric references Added support for group by all and order by all. The + later is ordering on all columns of the selection. The group by all + finds all expressions from the selections which aren't aggregations + and groups on those. All can also be replaced by '*'. + ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - restrict aliases, ie should be unique on both...
Changeset: 7a0f46ef26fb for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/7a0f46ef26fb Modified Files: sql/server/rel_select.c sql/test/BugTracker-2023/Tests/misc-crashes-7390.test sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test sql/test/BugTracker-2024/Tests/groupby-select1-Bug-7472.test Branch: default Log Message: restrict aliases, ie should be unique on both ends of the join diffs (82 lines): diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -5978,6 +5978,9 @@ rel_joinquery_(sql_query *query, symbol return NULL; query_processed(query); + if (strcmp(rel_name(t1), rel_name(t2)) == 0) { + return sql_error(sql, 02, SQLSTATE(42000) "SELECT: ERROR: table name '%s' specified more than once", rel_name(t1)); + } inner = rel = rel_crossproduct(sql->sa, t1, t2, op); if (!rel) return NULL; diff --git a/sql/test/BugTracker-2023/Tests/misc-crashes-7390.test b/sql/test/BugTracker-2023/Tests/misc-crashes-7390.test --- a/sql/test/BugTracker-2023/Tests/misc-crashes-7390.test +++ b/sql/test/BugTracker-2023/Tests/misc-crashes-7390.test @@ -363,18 +363,18 @@ x -- WITH v0 AS (SELECT 14, * FROM v0) INSERT INTO v0 SELECT v1 * 0 FROM v0 NATURAL JOIN v0, v0, v0 AS v2, v0, v0 AS v3 ORDER BY v1 * 0 / 77 statement ok -WITH v0 AS (SELECT 14, * FROM v0) INSERT INTO v0 SELECT v0.v1 * 0 FROM v0 NATURAL JOIN v0, v0, v0 AS v2, v0, v0 AS v3 ORDER BY v0.v1 * 0 / 77 +WITH v0 AS (SELECT 14, * FROM v0) INSERT INTO v0 SELECT v0.v1 * 0 FROM v0 NATURAL JOIN v0 v, v0 as v1, v0 AS v2, v0 as v3, v0 AS v4 ORDER BY v0.v1 * 0 / 77 query I nosort SELECT count(*) FROM v0 -131080 +16392 -- after the second insert, rerun same query as above, since it used to crash the server query RT rowsort SELECT * , 'x' FROM v0 WHERE (SELECT 39 WHERE (v1 + -32768 NOT IN (14, 255))) * 87 + 2147483647 -131080 values hashing to c051bd7cdccd1fd3636c9e0973aca08e +32776 values hashing to b2c71832cf3b6b1cb7d9db5b58419143 -- mul_bte_bte_bte: ERROR: 22003!overflow in calculation 87*39. diff --git a/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test b/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test --- a/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test +++ b/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test @@ -5,7 +5,7 @@ 1 1 query II nosort -WITH x AS ( SELECT 1 x ) SELECT 1 , ( SELECT x FROM x ) FROM ( x NATURAL JOIN x ) WHERE x +WITH x AS ( SELECT 1 x ) SELECT 1 , ( SELECT x FROM x ) FROM ( x NATURAL JOIN x y ) WHERE x 1 1 @@ -18,14 +18,14 @@ 1 1 query II nosort -SELECT * FROM ( WITH x AS ( SELECT 1 x ) SELECT 1 , x FROM ( x NATURAL JOIN x ) WHERE x ) y +SELECT * FROM ( WITH x AS ( SELECT 1 x ) SELECT 1 , x FROM ( x NATURAL JOIN x y ) WHERE x ) y 1 1 skipif knownfail query II nosort -SELECT * FROM ( WITH x AS ( SELECT 1 x ) SELECT 1 , ( SELECT x FROM x ) FROM ( x NATURAL JOIN x ) WHERE x ) y +SELECT * FROM ( WITH x AS ( SELECT 1 x ) SELECT 1 , ( SELECT x FROM x ) FROM ( x NATURAL JOIN x y ) WHERE x ) y 1 1 diff --git a/sql/test/BugTracker-2024/Tests/groupby-select1-Bug-7472.test b/sql/test/BugTracker-2024/Tests/groupby-select1-Bug-7472.test --- a/sql/test/BugTracker-2024/Tests/groupby-select1-Bug-7472.test +++ b/sql/test/BugTracker-2024/Tests/groupby-select1-Bug-7472.test @@ -1,9 +1,9 @@ query I nosort -SELECT ( WITH x AS ( SELECT 1 x ) SELECT 1 FROM ( x NATURAL JOIN x ) WHERE x NOT IN ( SELECT CASE WHEN x THEN ( SELECT 1 ) END GROUP BY 1 ) ) +SELECT ( WITH x AS ( SELECT 1 x ) SELECT 1 FROM ( x NATURAL JOIN x as y ) WHERE x NOT IN ( SELECT CASE WHEN x THEN ( SELECT 1 ) END GROUP BY 1 ) ) NULL query I nosort -SELECT ( WITH x AS ( SELECT 1 x ) SELECT 1 FROM ( x NATURAL JOIN x ) WHERE x NOT IN ( SELECT CASE WHEN x THEN ( SELECT 1 ) END GROUP BY ( SELECT 1 ) ) ) +SELECT ( WITH x AS ( SELECT 1 x ) SELECT 1 FROM ( x NATURAL JOIN x as y ) WHERE x NOT IN ( SELECT CASE WHEN x THEN ( SELECT 1 ) END GROUP BY ( SELECT 1 ) ) ) NULL ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - fix compilation (unused variable)
Changeset: 5ab32c5ce4a6 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/5ab32c5ce4a6 Modified Files: sql/server/rel_select.c Branch: default Log Message: fix compilation (unused variable) diffs (20 lines): diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -5609,7 +5609,7 @@ rel_select_exp(sql_query *query, sql_rel if (ce) { if (inner && inner->flag && is_groupby(inner->op)) { - int found = 0, nratom = 0; + int found = 0; list *gbe = inner->r; /* flag == 2 just add to group by/ aggrs and ref-to pexps*/ /* flag == 1 find group by exp referencing this column nr */ @@ -5630,7 +5630,6 @@ rel_select_exp(sql_query *query, sql_rel if (is_atom(e->type) && !e->alias.name) { atom *a = e->l; int nr = (int)atom_get_int(a); - nratom++; if (nr == (list_length(pexps) + 1)) { n->data = ce; ce = exp_ref(sql, ce); ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - fixed bug #7475 by improved check for distinc...
Changeset: a8b8f3b90564 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/a8b8f3b90564 Modified Files: sql/server/rel_exp.c sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test Branch: default Log Message: fixed bug #7475 by improved check for distinct expression names diffs (32 lines): diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -1169,7 +1169,8 @@ exp_equal( sql_exp *e1, sql_exp *e2) if (e1 == e2) return 0; if (e1->alias.rname && e2->alias.rname && strcmp(e1->alias.rname, e2->alias.rname) == 0) - return strcmp(e1->alias.name, e2->alias.name); + if (e1->alias.name && e2->alias.name && strcmp(e1->alias.name, e2->alias.name) == 0) + return 0; if (!e1->alias.rname && !e2->alias.rname && e1->alias.label == e2->alias.label && e1->alias.name && e2->alias.name) return strcmp(e1->alias.name, e2->alias.name); return -1; diff --git a/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test b/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test --- a/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test +++ b/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test @@ -10,7 +10,6 @@ WITH x AS ( SELECT 1 x ) SELECT 1 , ( SE 1 1 -skipif knownfail query II nosort SELECT * FROM ( WITH x AS ( SELECT 1 x ) SELECT 1 , ( SELECT x FROM x ) FROM x WHERE x ) y @@ -23,7 +22,6 @@ SELECT * FROM ( WITH x AS ( SELECT 1 x ) 1 1 -skipif knownfail query II nosort SELECT * FROM ( WITH x AS ( SELECT 1 x ) SELECT 1 , ( SELECT x FROM x ) FROM ( x NATURAL JOIN x y ) WHERE x ) y ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - bug #7480 was fixed by recent changes
Changeset: 601eea2d633f for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/601eea2d633f Modified Files: sql/test/BugTracker-2024/Tests/get_rel_count-Bug-7480.test Branch: default Log Message: bug #7480 was fixed by recent changes diffs (11 lines): diff --git a/sql/test/BugTracker-2024/Tests/get_rel_count-Bug-7480.test b/sql/test/BugTracker-2024/Tests/get_rel_count-Bug-7480.test --- a/sql/test/BugTracker-2024/Tests/get_rel_count-Bug-7480.test +++ b/sql/test/BugTracker-2024/Tests/get_rel_count-Bug-7480.test @@ -8,7 +8,6 @@ SELECT NULL GROUP BY 1 NULL -skipif knownfail query I nosort SELECT CASE WHEN ( SELECT 2 WHERE FALSE ) > ANY ( 1 ) THEN 1 END GROUP BY 1 ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - bug #7476 fixed by changes to group by
Changeset: b247a3a24ae7 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/b247a3a24ae7 Modified Files: sql/test/BugTracker-2024/Tests/rel2bin_join-Bug-7476.test Branch: default Log Message: bug #7476 fixed by changes to group by diffs (17 lines): diff --git a/sql/test/BugTracker-2024/Tests/rel2bin_join-Bug-7476.test b/sql/test/BugTracker-2024/Tests/rel2bin_join-Bug-7476.test --- a/sql/test/BugTracker-2024/Tests/rel2bin_join-Bug-7476.test +++ b/sql/test/BugTracker-2024/Tests/rel2bin_join-Bug-7476.test @@ -26,13 +26,11 @@ SELECT ( WITH x ( x ) AS ( SELECT DISTIN 1 -- the combination leads to crash in rel2bin_join () -skipif knownfail query I nosort WITH x ( x ) AS ( SELECT DISTINCT 1 ) SELECT ( SELECT x FROM x WHERE x = ( SELECT ( CASE WHEN x THEN x END ) WHERE x = ( SELECT x FROM x ) AND x GROUP BY 1 ) ) FROM x 1 -skipif knownfail query I nosort SELECT ( WITH x ( x ) AS ( SELECT DISTINCT 1 ) SELECT ( SELECT x FROM x WHERE x = ( SELECT ( CASE WHEN x THEN x END ) WHERE x = ( SELECT x FROM x ) AND x GROUP BY 1 ) ) FROM x ) ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - #7506 was recently fixed
Changeset: d4f8e2e2ff1f for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/d4f8e2e2ff1f Modified Files: sql/test/BugTracker-2024/Tests/rel2bin_select-Bug-7496.test Branch: default Log Message: #7506 was recently fixed diffs (11 lines): diff --git a/sql/test/BugTracker-2024/Tests/rel2bin_select-Bug-7496.test b/sql/test/BugTracker-2024/Tests/rel2bin_select-Bug-7496.test --- a/sql/test/BugTracker-2024/Tests/rel2bin_select-Bug-7496.test +++ b/sql/test/BugTracker-2024/Tests/rel2bin_select-Bug-7496.test @@ -29,7 +29,6 @@ SELECT "is_generated", length("is_genera -- next query causes: sql/backends/monet5/rel_bin.c:4355: rel2bin_select: Assertion `sql->session->status == -10' failed -skipif knownfail query TI nosort SELECT "is_generated", length("is_generated") as data_length FROM columns_7496 WHERE "is_generated" IS NOT NULL AND length("is_generated") > 2 ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - #7485 was fixed by recent group by changes
Changeset: b729bea76345 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/b729bea76345 Modified Files: sql/test/BugTracker-2024/Tests/rel_groupby_cse-Bug-7485.test Branch: default Log Message: #7485 was fixed by recent group by changes diffs (28 lines): diff --git a/sql/test/BugTracker-2024/Tests/rel_groupby_cse-Bug-7485.test b/sql/test/BugTracker-2024/Tests/rel_groupby_cse-Bug-7485.test --- a/sql/test/BugTracker-2024/Tests/rel_groupby_cse-Bug-7485.test +++ b/sql/test/BugTracker-2024/Tests/rel_groupby_cse-Bug-7485.test @@ -7,15 +7,18 @@ statement error 42000!SELECT: cannot use WITH x ( x ) AS ( SELECT 1 ) SELECT x FROM x GROUP BY x + 1 -skipif knownfail -statement error 42000!SELECT: cannot use non GROUP BY column 'x' in query results without an aggregate function +query I nosort WITH x ( x ) AS ( SELECT 1 ) SELECT x FROM x GROUP BY x + 1 , x + +1 -skipif knownfail -statement error 42000!SELECT: cannot use non GROUP BY column 'x' in query results without an aggregate function +query I nosort WITH x ( x ) AS ( SELECT 1 ) SELECT ( x ) FROM x WHERE ( SELECT x FROM x GROUP BY x + 1 , x ) + +1 -skipif knownfail -statement error 42000!SELECT: cannot use non GROUP BY column 'x' in query results without an aggregate function +query I nosort SELECT ( WITH x ( x ) AS ( SELECT 1 ) SELECT ( x ) FROM x WHERE ( SELECT x FROM x GROUP BY x + 1 , x ) ) + +1 ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - Changed some RPM names.
Changeset: 5c135739277f for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/5c135739277f Modified Files: ChangeLog MonetDB.spec Branch: default Log Message: Changed some RPM names. MonetDB5-server -> MonetDB-server MonetDB5-libs -> MonetDB-libs MonetDB-SQL-server5 -> MonetDB-SQL MonetDB-geom-MonetDB5 -> MonetDB-geom diffs (truncated from 363 to 300 lines): diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog file for devel # This file is updated with Maddlog +* Wed May 8 2024 Sjoerd Mullender +- The names of some of the provided RPM files have been changed. + References to the old MonetDB5 name have been removed. All packages + are now just MonetDB. + * Wed May 8 2024 Niels Nes - Add support for select exp, count(*) group by 1 order by 1; ie. using numeric references Added support for group by all and order by all. The diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -57,7 +57,7 @@ # available. However, the geos library is available in the Extra # Packages for Enterprise Linux (EPEL). %if %{fedpkgs} && (0%{?rhel} != 7) && (0%{?rhel} != 8) -# By default create the MonetDB-geom-MonetDB5 package on Fedora and RHEL 7 +# By default create the MonetDB-geom package on Fedora and RHEL 7 %bcond_without geos %endif @@ -154,8 +154,8 @@ BuildRequires: pkgconfig(libR) # BuildRequires: pkgconfig(valgrind)# -DWITH_VALGRIND=ON %if (0%{?fedora} >= 22) -Recommends: %{name}-SQL-server5%{?_isa} = %{version}-%{release} -Recommends: MonetDB5-server%{?_isa} = %{version}-%{release} +Recommends: %{name}-SQL%{?_isa} = %{version}-%{release} +Recommends: %{name}-server%{?_isa} = %{version}-%{release} Suggests: %{name}-client%{?_isa} = %{version}-%{release} %endif @@ -167,8 +167,8 @@ accelerators. It also has an SQL front This package contains the core components of MonetDB in the form of a single shared library. If you want to use MonetDB, you will certainly -need this package, but you will also need at least the MonetDB5-server -package, and most likely also %{name}-SQL-server5, as well as one or +need this package, but you will also need at least the %{name}-server +package, and most likely also %{name}-SQL, as well as one or more client packages. %ldconfig_scriptlets @@ -254,8 +254,8 @@ library. Summary: MonetDB - Monet Database Management System Client Programs Group: Applications/Databases %if (0%{?fedora} >= 22) -Recommends: %{name}-SQL-server5%{?_isa} = %{version}-%{release} -Recommends: MonetDB5-server%{?_isa} = %{version}-%{release} +Recommends: %{name}-SQL%{?_isa} = %{version}-%{release} +Recommends: %{name}-server%{?_isa} = %{version}-%{release} %endif %description client-lib @@ -280,8 +280,8 @@ Summary: MonetDB - Monet Database Manage Group: Applications/Databases Requires: %{name}-client-lib%{?_isa} = %{version}-%{release} %if (0%{?fedora} >= 22) -Recommends: %{name}-SQL-server5%{?_isa} = %{version}-%{release} -Recommends: MonetDB5-server%{?_isa} = %{version}-%{release} +Recommends: %{name}-SQL%{?_isa} = %{version}-%{release} +Recommends: %{name}-server%{?_isa} = %{version}-%{release} %endif %description client @@ -368,14 +368,14 @@ fi %package client-tests Summary: MonetDB Client tests package Group: Applications/Databases -Requires: MonetDB5-server%{?_isa} = %{version}-%{release} +Requires: %{name}-server%{?_isa} = %{version}-%{release} Requires: %{name}-client%{?_isa} = %{version}-%{release} Requires: %{name}-client-odbc%{?_isa} = %{version}-%{release} %if (0%{?fedora} >= 22) Recommends: perl-DBD-monetdb >= 1.0 Recommends: php-monetdb >= 1.0 %endif -Requires: MonetDB5-server%{?_isa} = %{version}-%{release} +Requires: %{name}-server%{?_isa} = %{version}-%{release} %if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} > 7 Recommends: python3dist(lz4) Recommends: python3dist(scipy) @@ -414,21 +414,24 @@ developer. %{_bindir}/sqlsample.pl %if %{with geos} -%package geom-MonetDB5 -Summary: MonetDB5 SQL GIS support module +%package geom +Summary: SQL GIS support module for MonetDB Group: Applications/Databases -Requires: MonetDB5-server%{?_isa} = %{version}-%{release} +Requires: %{name}-server%{?_isa} = %{version}-%{release} +Obsoletes: MonetDB-geom-MonetDB5 < 11.50.0 +Provides: %{name}-geom-MonetDB5 = %{version}-%{release} +Provides: %{name}-geom-MonetDB5%{?_isa} = %{version}-%{release} -%description geom-MonetDB5 +%description geom MonetDB is a database management system that is developed from a main-memory perspective with use of a fully decomposed storage model, automatic index management, extensibility of data types and search accelerators. It also has an SQL front end. This package contains the GIS (Geographic Information System) -extensions for MonetDB5-server. +extensions for %{name}-server. -%files geom-MonetDB5 +%files geom %defattr(-,root,root) %{_libdir}/monetdb5/lib_geom.so %endif @@ -437,7 +440,7 @@ extensions for MonetDB5-server. %pa
MonetDB: default - Rename Debian/Ubuntu packages to remove the n...
Changeset: 9b849f13bc02 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/9b849f13bc02 Modified Files: ChangeLog debian/control Branch: default Log Message: Rename Debian/Ubuntu packages to remove the name "monetdb5". diffs (237 lines): diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ # This file is updated with Maddlog * Wed May 8 2024 Sjoerd Mullender +- Some of the Debian/Ubuntu packages have been renamed. The old monetdb5 + names have been changed to plain monetdb, and libmonetdb5-server-* + packages have been renamed monetdb-*. - The names of some of the provided RPM files have been changed. References to the old MonetDB5 name have been removed. All packages are now just MonetDB. diff --git a/debian/control b/debian/control --- a/debian/control +++ b/debian/control @@ -18,7 +18,6 @@ Package: libmonetdb28 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libmonetdb-stream26 (= ${source:Version}) -Conflicts: libmonetdb5-server-geom (<< ${source:Version}) Description: MonetDB core library MonetDB is a database management system that is developed from a main-memory perspective with use of a fully decomposed storage model, @@ -27,8 +26,8 @@ Description: MonetDB core library . This package contains the core components of MonetDB in the form of a single shared library. If you want to use MonetDB, you will certainly - need this package, but you will also need at least the monetdb5-server - package, and most likely also monetdb5-sql, as well as one or + need this package, but you will also need at least the monetdb-server + package, and most likely also monetdb-sql, as well as one or more client packages. Package: libmonetdb-dev @@ -101,8 +100,8 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libmonetdb-client26 (= ${source:Version}), libmonetdb-stream26 (= ${source:Version}) -Recommends: monetdb5-sql (= ${source:Version}), - monetdb5-server (= ${source:Version}) +Recommends: monetdb-sql (= ${source:Version}), + monetdb-server (= ${source:Version}) Description: MonetDB database client MonetDB is a database management system that is developed from a main-memory perspective with use of a fully decomposed storage model, @@ -132,10 +131,10 @@ Depends: ${shlibs:Depends}, libmonetdb-c libmonetdb-client26 (= ${source:Version}), libmonetdb-stream26 (= ${source:Version}), libmonetdb28 (= ${source:Version}), - monetdb5-server (= ${source:Version}), + monetdb-server (= ${source:Version}), libdbd-monetdb-perl (>= 1.0), php-monetdb (>= 1.0), - monetdb5-server (= ${source:Version}) + monetdb-server (= ${source:Version}) Description: MonetDB client testing tools MonetDB is a database management system that is developed from a main-memory perspective with use of a fully decomposed storage model, @@ -147,28 +146,44 @@ Description: MonetDB client testing tool developer. Package: libmonetdb5-server-geom +Architecture: all +Depends: monetdb-geom +Description: transitional package + This is a transitional package. It can safely be removed. + +Package: monetdb-geom Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libmonetdb-stream26 (= ${source:Version}), libmonetdb28 (= ${source:Version}), - monetdb5-server (= ${source:Version}) -Description: MonetDB5 SQL GIS support module + monetdb-server (= ${source:Version}) +Replaces: libmonetdb5-server-geom (<< 11.50.0) +Break: libmonetdb5-server-geom (<< 11.50.0) +Description: MonetDB SQL GIS support module MonetDB is a database management system that is developed from a main-memory perspective with use of a fully decomposed storage model, automatic index management, extensibility of data types and search accelerators. It also has an SQL front end. . This package contains the GIS (Geographic Information System) - extensions for monetdb5-server. + extensions for monetdb-server. Package: libmonetdb5-server-cfitsio +Architecture: all +Depends: monetdb-cfitsio +Description: transitional package + This is a transitional package. It can safely be removed. + +Package: monetdb-cfitsio Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libmonetdb28 (= ${source:Version}), - monetdb5-server (= ${source:Version}) -Description: MonetDB5 add on module for FITS files + monetdb-server (= ${source:Version}) +Replaces: libmonetdb5-server-cfitsio (<< 11.50.0) +Break: libmonetdb5-server-cfitsio (<< 11.50.0) +Description: MonetDB add on module for FITS files MonetDB is a database management system that is developed from a main-memory perspective with use of a fully decomposed storage model, automatic index management, extensibility of data types and search @@ -178,16 +193,24 @@ Description: MonetDB5 add on module for format. Package: monetdb5-server +Architecture: all +Depends: monetdb-server +Description: transitional package + This is a transitional package.
MonetDB: default - Remove upgrade obsoleting of hugeint packages.
Changeset: 6dfe9fabdab4 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/6dfe9fabdab4 Modified Files: MonetDB.spec debian/control Branch: default Log Message: Remove upgrade obsoleting of hugeint packages. diffs (47 lines): diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -543,11 +543,6 @@ Group: Applications/Databases Requires(pre): shadow-utils Requires: %{name}-client%{?_isa} = %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release} -Obsoletes: MonetDB5-server-hugeint < 11.38.0 -%if %{with hugeint} -Provides: %{name}-server-hugeint%{?_isa} = %{version}-%{release} -Provides: MonetDB5-server-hugeint%{?_isa} = %{version}-%{release} -%endif Obsoletes: MonetDB5-server < 11.50.0 Provides: MonetDB5-server = %{version}-%{release} Provides: MonetDB5-server%{?_isa} = %{version}-%{release} @@ -630,10 +625,6 @@ used from the MAL level. Summary: MonetDB SQL server modules Group: Applications/Databases Requires(pre): %{name}-server%{?_isa} = %{version}-%{release} -Obsoletes: MonetDB-SQL-server5-hugeint < 11.38.0 -%if %{with hugeint} -Provides: %{name}-SQL-hugeint%{?_isa} = %{version}-%{release} -%endif Obsoletes: MonetDB-SQL-server5 < 11.50.0 Provides: %{name}-SQL-server5 = %{version}-%{release} Provides: %{name}-SQL-server5%{?_isa} = %{version}-%{release} diff --git a/debian/control b/debian/control --- a/debian/control +++ b/debian/control @@ -206,8 +206,6 @@ Depends: ${shlibs:Depends}, ${misc:Depen libmonetdb28 (= ${source:Version}), Recommends: monetdb-sql (= ${source:Version}) Suggests: monetdb-client (= ${source:Version}) -Conflicts: monetdb5-server-hugeint (<< 11.38.0) -Replaces: monetdb5-server-hugeint (<< 11.38.0) Replaces: monetdb5-server (<< 11.50.0) Break: monetdb5-server (<< 11.50.0) Description: MonetDB database server @@ -254,8 +252,6 @@ Depends: ${shlibs:Depends}, ${misc:Depen libmonetdb-client26 (= ${source:Version}), libmonetdb-stream26 (= ${source:Version}), monetdb-server (= ${source:Version}) -Conflicts: monetdb5-sql-hugeint (<< 11.38.0) -Replaces: monetdb5-sql-hugeint (<< 11.38.0) Replaces: monetdb5-sql (<< 11.50.0) Break: monetdb5-sql (<< 11.50.0) Suggests: monetdb-client (= ${source:Version}) ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: balanced_union - Mergetables unionized with munion by d...
Changeset: 2afc5cbdfcc1 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/2afc5cbdfcc1 Modified Files: sql/server/rel_optimizer.c Branch: balanced_union Log Message: Mergetables unionized with munion by default diffs (29 lines): diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -428,12 +428,6 @@ merge_table_prune_and_unionize(visitor * nrel = rel_setop_n_ary(v->sql->sa, tables, op_munion); } } else if (mvc_debug_on(v->sql, 32)) { - if (tables->cnt == 1) { - nrel = rel_wrap_select_around_table(v, tables->h->data, info); - } else { - nrel = rel_unionize_mt_tables_munion(v, mt_rel, tables, info); - } - } else { for (node *n = tables->h; n ; n = n->next) { sql_rel *next = n->data; sql_table *subt = (sql_table *) next->l; @@ -455,6 +449,12 @@ merge_table_prune_and_unionize(visitor * nrel = next; } } + } else { + if (tables->cnt == 1) { + nrel = rel_wrap_select_around_table(v, tables->h->data, info); + } else { + nrel = rel_unionize_mt_tables_munion(v, mt_rel, tables, info); + } } } return nrel; ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: balanced_union - Renames function for mt unionization
Changeset: 0121faa509fb for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/0121faa509fb Modified Files: sql/server/rel_optimizer.c Branch: balanced_union Log Message: Renames function for mt unionization diffs (51 lines): diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -56,7 +56,7 @@ typedef struct { } merge_table_prune_info; static sql_rel * -rel_wrap_select_around_table(visitor *v, sql_rel *t, merge_table_prune_info *info) +rel_wrap_select_around_mt_child(visitor *v, sql_rel *t, merge_table_prune_info *info) { // TODO: it has to be a table (merge table component) add checks sql_table *subt = (sql_table *)t->l; @@ -89,9 +89,9 @@ rel_unionize_mt_tables_balanced(visitor /* merge (via union) every *two* consequtive nodes of the list */ for (node *n = tables->h; n && n->next; n = n->next->next) { /* first (left) node */ - sql_rel *tl = rel_wrap_select_around_table(v, n->data, info); + sql_rel *tl = rel_wrap_select_around_mt_child(v, n->data, info); /* second (right) node */ - sql_rel *tr = rel_wrap_select_around_table(v, n->next->data, info); + sql_rel *tr = rel_wrap_select_around_mt_child(v, n->next->data, info); /* create the union */ sql_rel *tu = rel_setop(v->sql->sa, tl, tr, op_union); rel_setop_set_exps(v->sql, tu, rel_projections(v->sql, mt, NULL, 1, 1), true); @@ -112,7 +112,7 @@ rel_unionize_mt_tables_munion(visitor *v /* create the list of all the operand rels */ list *rels = sa_list(v->sql->sa); for (node *n = tables->h; n; n = n->next) { - sql_rel *r = rel_wrap_select_around_table(v, n->data, info); + sql_rel *r = rel_wrap_select_around_mt_child(v, n->data, info); append(rels, r); } @@ -422,7 +422,7 @@ merge_table_prune_and_unionize(visitor * if (mvc_debug_on(v->sql, 16)) { /* In case of a single table there in nothing to unionize */ if (tables->cnt == 1) { - nrel = rel_wrap_select_around_table(v, tables->h->data, info); + nrel = rel_wrap_select_around_mt_child(v, tables->h->data, info); } else { //nrel = rel_unionize_mt_tables_balanced(v, mt_rel, tables, info); nrel = rel_setop_n_ary(v->sql->sa, tables, op_munion); @@ -451,7 +451,7 @@ merge_table_prune_and_unionize(visitor * } } else { if (tables->cnt == 1) { - nrel = rel_wrap_select_around_table(v, tables->h->data, info); + nrel = rel_wrap_select_around_mt_child(v, tables->h->data, info); } else { nrel = rel_unionize_mt_tables_munion(v, mt_rel, tables, info); } ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: balanced_union - Fixes expected plan with munion instea...
Changeset: e566e8978d5c for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/e566e8978d5c Modified Files: sql/test/mergetables/Tests/mergequery.test Branch: balanced_union Log Message: Fixes expected plan with munion instead of union diffs (21 lines): diff --git a/sql/test/mergetables/Tests/mergequery.test b/sql/test/mergetables/Tests/mergequery.test --- a/sql/test/mergetables/Tests/mergequery.test +++ b/sql/test/mergetables/Tests/mergequery.test @@ -196,7 +196,7 @@ SELECT * FROM complete where x > 1.0 AND query T nosort PLAN SELECT * FROM complete where x >= 1.0 AND x <= 2.0 -union ( +munion ( | project ( | | select ( | | | table("sys"."part1") [ "part1"."x" NOT NULL as "complete"."x", "part1"."y" NOT NULL as "complete"."y", "part1"."z" NOT NULL as "complete"."z" ] @@ -228,7 +228,7 @@ 0.000 query T nosort PLAN SELECT * FROM complete WHERE x BETWEEN 0 AND 2 AND Y BETWEEN 0 AND 2 -union ( +munion ( | project ( | | table("sys"."part1") [ "part1"."x" NOT NULL as "complete"."x", "part1"."y" NOT NULL as "complete"."y", "part1"."z" NOT NULL as "complete"."z" ] | ) [ "complete"."x" NOT NULL, "complete"."y" NOT NULL, "complete"."z" NOT NULL ], ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: balanced_union - Fixes expected plan with munion instea...
Changeset: 6600ed068099 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/6600ed068099 Modified Files: sql/test/mergetables/Tests/part-elim.test Branch: balanced_union Log Message: Fixes expected plan with munion instead of union diffs (48 lines): diff --git a/sql/test/mergetables/Tests/part-elim.test b/sql/test/mergetables/Tests/part-elim.test --- a/sql/test/mergetables/Tests/part-elim.test +++ b/sql/test/mergetables/Tests/part-elim.test @@ -52,7 +52,7 @@ analyze sys.mt2 (id,posX) query T nosort plan select * from test where id between 1 and 1 -union ( +munion ( | project ( | | table("sys"."mt1") [ "mt1"."id" NOT NULL UNIQUE as "test"."id", "mt1"."posx" NOT NULL UNIQUE as "test"."posx" ] | ) [ "test"."id" NOT NULL UNIQUE, "test"."posx" NOT NULL UNIQUE ], @@ -71,7 +71,7 @@ project ( query T nosort plan select * from test where id between 1 and 1 -union ( +munion ( | project ( | | table("sys"."mt1") [ "mt1"."id" NOT NULL UNIQUE as "test"."id", "mt1"."posx" NOT NULL UNIQUE as "test"."posx" ] | ) [ "test"."id" NOT NULL UNIQUE, "test"."posx" NOT NULL UNIQUE ], @@ -90,7 +90,7 @@ project ( query T nosort plan select * from test where id between 1 and 1000*10 -union ( +munion ( | project ( | | table("sys"."mt1") [ "mt1"."id" NOT NULL UNIQUE as "test"."id", "mt1"."posx" NOT NULL UNIQUE as "test"."posx" ] | ) [ "test"."id" NOT NULL UNIQUE, "test"."posx" NOT NULL UNIQUE ], @@ -102,7 +102,7 @@ union ( query T nosort plan select * from test where id between 1 and 100*10 -union ( +munion ( | project ( | | select ( | | | table("sys"."mt1") [ "mt1"."id" NOT NULL UNIQUE as "test"."id", "mt1"."posx" NOT NULL UNIQUE as "test"."posx" ] @@ -118,7 +118,7 @@ union ( query T nosort plan select * from test where id in (1, 1022) -union ( +munion ( | project ( | | select ( | | | table("sys"."mt1") [ "mt1"."id" NOT NULL UNIQUE as "test"."id", "mt1"."posx" NOT NULL UNIQUE as "test"."posx" ] ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: balanced_union - Fix plans of merge table tests
Changeset: fdcfc9ab7e9e for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/fdcfc9ab7e9e Modified Files: sql/test/merge-partitions/Tests/mergepart31.test Branch: balanced_union Log Message: Fix plans of merge table tests diffs (292 lines): diff --git a/sql/test/merge-partitions/Tests/mergepart31.test b/sql/test/merge-partitions/Tests/mergepart31.test --- a/sql/test/merge-partitions/Tests/mergepart31.test +++ b/sql/test/merge-partitions/Tests/mergepart31.test @@ -49,7 +49,7 @@ project ( query T nosort plan select 1 from splitted where stamp IN (TIMESTAMP '2000-01-01 00:00:00', TIMESTAMP '2010-01-01 00:00:00') -union ( +munion ( | project ( | | select ( | | | table("sys"."first_decade") [ "first_decade"."stamp" UNIQUE as "splitted"."stamp" ] @@ -65,25 +65,23 @@ union ( query T nosort plan select 1 from splitted where stamp IN (TIMESTAMP '2000-02-01 00:00:00', TIMESTAMP '2010-02-01 00:00:00', TIMESTAMP '2020-02-01 00:00:00') -union ( -| union ( -| | project ( -| | | select ( -| | | | table("sys"."first_decade") [ "first_decade"."stamp" UNIQUE as "splitted"."stamp" ] -| | | ) [ ("splitted"."stamp" UNIQUE) in (timestamp(7) "2000-02-01 00:00:00.00", timestamp(7) "2010-02-01 00:00:00.00", timestamp(7) "2020-02-01 00:00:00.00") ] -| | ) [ tinyint(1) "1" ], -| | project ( -| | | select ( -| | | | table("sys"."second_decade") [ "second_decade"."stamp" UNIQUE as "splitted"."stamp" ] -| | | ) [ ("splitted"."stamp" UNIQUE) in (timestamp(7) "2000-02-01 00:00:00.00", timestamp(7) "2010-02-01 00:00:00.00", timestamp(7) "2020-02-01 00:00:00.00") ] -| | ) [ tinyint(1) "1" ] -| ) [ "%7"."%7" NOT NULL ], +munion ( +| project ( +| | select ( +| | | table("sys"."first_decade") [ "first_decade"."stamp" UNIQUE as "splitted"."stamp" ] +| | ) [ ("splitted"."stamp" UNIQUE) in (timestamp(7) "2000-02-01 00:00:00.00", timestamp(7) "2010-02-01 00:00:00.00", timestamp(7) "2020-02-01 00:00:00.00") ] +| ) [ tinyint(1) "1" ], +| project ( +| | select ( +| | | table("sys"."second_decade") [ "second_decade"."stamp" UNIQUE as "splitted"."stamp" ] +| | ) [ ("splitted"."stamp" UNIQUE) in (timestamp(7) "2000-02-01 00:00:00.00", timestamp(7) "2010-02-01 00:00:00.00", timestamp(7) "2020-02-01 00:00:00.00") ] +| ) [ tinyint(1) "1" ], | project ( | | select ( | | | table("sys"."third_decade") [ "third_decade"."stamp" UNIQUE as "splitted"."stamp" ] | | ) [ ("splitted"."stamp" UNIQUE) in (timestamp(7) "2000-02-01 00:00:00.00", timestamp(7) "2010-02-01 00:00:00.00", timestamp(7) "2020-02-01 00:00:00.00") ] | ) [ tinyint(1) "1" ] -) [ "%6"."%6" NOT NULL ] +) [ "%10"."%10" NOT NULL ] query T nosort plan select 1 from splitted where stamp BETWEEN TIMESTAMP '2020-01-01 00:00:00' AND TIMESTAMP '2020-10-01 00:00:00' @@ -97,7 +95,7 @@ project ( query T nosort plan select 1 from splitted where stamp NOT BETWEEN TIMESTAMP '2020-01-01 00:00:00' AND TIMESTAMP '2020-10-01 00:00:00' -union ( +munion ( | project ( | | select ( | | | table("sys"."first_decade") [ "first_decade"."stamp" UNIQUE as "splitted"."stamp" ] @@ -113,7 +111,7 @@ union ( query T nosort plan select 1 from splitted where stamp BETWEEN TIMESTAMP '2010-01-01 00:00:00' AND TIMESTAMP '2020-03-01 00:00:00' -union ( +munion ( | project ( | | select ( | | | table("sys"."second_decade") [ "second_decade"."stamp" UNIQUE as "splitted"."stamp" ] @@ -129,25 +127,23 @@ union ( query T nosort plan select 1 from splitted where stamp BETWEEN TIMESTAMP '2000-02-01 00:00:00' AND TIMESTAMP '2020-03-01 00:00:00' -union ( -| union ( -| | project ( -| | | select ( -| | | | table("sys"."first_decade") [ "first_decade"."stamp" UNIQUE as "splitted"."stamp" ] -| | | ) [ (timestamp(7) "2000-02-01 00:00:00.00") <= ("splitted"."stamp" UNIQUE) <= (timestamp(7) "2020-03-01 00:00:00.00") ] -| | ) [ tinyint(1) "1" ], -| | project ( -| | | select ( -| | | | table("sys"."second_decade") [ "second_decade"."stamp" UNIQUE as "splitted"."stamp" ] -| | | ) [ (timestamp(7) "2000-02-01 00:00:00.00") <= ("splitted"."stamp" UNIQUE) <= (timestamp(7) "2020-03-01 00:00:00.00") ] -| | ) [ tinyint(1) "1" ] -| ) [ "%6"."%6" NOT NULL ], +munion ( +| project ( +| | select ( +| | | table("sys"."first_decade") [ "first_decade"."stamp" UNIQUE as "splitted"."stamp" ] +| | ) [ (timestamp(7) "2000-02-01 00:00:00.00") <= ("splitted"."stamp" UNIQUE) <= (timestamp(7) "2020-03-01 00:00:00.00") ] +| ) [ tinyint(1) "1" ], +| project ( +| | select ( +| | | table("sys"."second_decade") [ "second_decade"."stamp" UNIQUE as "splitted"."stamp" ] +| | ) [ (timestamp(7) "2000-02-01 00:00:00.00") <= ("splitted"."stamp" UNIQUE) <= (timestamp(7) "2020-03-01 00:00:00.00") ] +| ) [ tinyint(1) "1" ], | project ( | | select ( | | | table("sys"."third_decade") [ "third_decade"."stamp" UNIQUE as "splitted"."stamp" ] | | ) [ (timestamp(7) "2000-02-01 00:00:00.00") <= ("spli
MonetDB: Dec2023 - improved optimization of relational psm
Changeset: e9afbe5ac9c3 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/e9afbe5ac9c3 Modified Files: sql/server/rel_optimize_others.c sql/server/rel_optimizer.c sql/server/rel_rel.c sql/server/rel_rel.h sql/server/rel_select.c sql/test/BugTracker-2022/Tests/dependencies.Bug-7328.test sql/test/Dependencies/Tests/dependency_DBobjects.test sql/test/Dependencies/Tests/dependency_owner_schema_3.test sql/test/SQLancer/Tests/sqlancer18.test sql/test/emptydb/Tests/check.stable.out sql/test/emptydb/Tests/check.stable.out.32bit sql/test/emptydb/Tests/check.stable.out.int128 sql/test/sql_dump/Tests/dump.test Branch: Dec2023 Log Message: improved optimization of relational psm diffs (truncated from 564 to 300 lines): diff --git a/sql/server/rel_optimize_others.c b/sql/server/rel_optimize_others.c --- a/sql/server/rel_optimize_others.c +++ b/sql/server/rel_optimize_others.c @@ -1054,6 +1054,7 @@ rel_dce_(mvc *sql, sql_rel *rel) return rel; } + /* Remove unused expressions */ static sql_rel * rel_dce(visitor *v, global_props *gp, sql_rel *rel) diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -607,8 +607,8 @@ run_optimizer_set(visitor *v, sql_optimi /* 'profile' means to benchmark each individual optimizer run */ /* 'instantiate' means to rewrite logical tables: (merge, remote, replica tables) */ -sql_rel * -rel_optimizer(mvc *sql, sql_rel *rel, int profile, int instantiate, int value_based_opt, int storage_based_opt) +static sql_rel * +rel_optimizer_one(mvc *sql, sql_rel *rel, int profile, int instantiate, int value_based_opt, int storage_based_opt) { global_props gp = (global_props) {.cnt = {0}, .instantiate = (uint8_t)instantiate, .opt_cycle = 0, .has_special_modify = rel && is_modify(rel->op) && rel->flag&UPD_COMP}; @@ -635,3 +635,32 @@ rel_optimizer(mvc *sql, sql_rel *rel, in rel = run_optimizer_set(&v, sql->runs, rel, &gp, post_sql_optimizers); return rel; } + +static sql_exp * +exp_optimize_one(visitor *v, sql_rel *rel, sql_exp *e, int depth ) +{ + (void)rel; + (void)depth; + if (e->type == e_psm && e->flag == PSM_REL && e->l) { + e->l = rel_optimizer_one(v->sql, e->l, 0, v->changes, v->value_based_opt, v->storage_based_opt); + } + return e; +} + +sql_rel * +rel_optimizer(mvc *sql, sql_rel *rel, int profile, int instantiate, int value_based_opt, int storage_based_opt) +{ + if (rel && rel->op == op_ddl && rel->flag == ddl_psm) { + if (!list_empty(rel->exps)) { + bool changed = 0; + visitor v = { .sql = sql, .value_based_opt = value_based_opt, .storage_based_opt = storage_based_opt, .changes = instantiate }; + for(node *n = rel->exps->h; n; n = n->next) { + sql_exp *e = n->data; + exp_visitor(&v, rel, e, 1, exp_optimize_one, true, true, true, &changed); + } + } + return rel; + } else { + return rel_optimizer_one(sql, rel, profile, instantiate, value_based_opt, storage_based_opt); + } +} diff --git a/sql/server/rel_rel.c b/sql/server/rel_rel.c --- a/sql/server/rel_rel.c +++ b/sql/server/rel_rel.c @@ -2044,17 +2044,17 @@ rel_dependencies(mvc *sql, sql_rel *r) return l; } -static list *exps_exp_visitor(visitor *v, sql_rel *rel, list *exps, int depth, exp_rewrite_fptr exp_rewriter, bool topdown, bool relations_topdown); +static list *exps_exp_visitor(visitor *v, sql_rel *rel, list *exps, int depth, exp_rewrite_fptr exp_rewriter, bool topdown, bool relations_topdown, bool visit_relations_once); static inline list * -exps_exps_exp_visitor(visitor *v, sql_rel *rel, list *lists, int depth, exp_rewrite_fptr exp_rewriter, bool topdown, bool relations_topdown) +exps_exps_exp_visitor(visitor *v, sql_rel *rel, list *lists, int depth, exp_rewrite_fptr exp_rewriter, bool topdown, bool relations_topdown, bool visit_relations_once) { node *n; if (list_empty(lists)) return lists; for (n = lists->h; n; n = n->next) { - if (n->data && (n->data = exps_exp_visitor(v, rel, n->data, depth, exp_rewriter, topdown, relations_topdown)) == NULL) + if (n->data && (n->data = exps_exp_visitor(v, rel, n->data, depth, exp_rewriter, topdown, relations_topdown, visit_relations_once)) == NULL) return NULL; } return lists; @@ -2062,8 +2062,8 @@ exps_exps_exp_visitor(visitor *v, sql_re static sql_rel *rel_exp_visitor(visitor *v, sql_rel *rel, exp_rewrite_fptr exp_rewriter, bool topdown, bool relations_topdown); -static sql_exp *