Changeset: 0faee038cabb for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0faee038cabb Modified Files: sql/server/rel_exp.c sql/server/rel_optimizer.c sql/test/SQLancer/Tests/sqlancer01.stable.out sql/test/miscellaneous/Tests/simple_plans.stable.out sql/test/miscellaneous/Tests/simple_selects.stable.out Branch: default Log Message:
Merged with Oct2020 diffs (truncated from 424 to 300 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 @@ -410,6 +410,8 @@ exp_atom(sql_allocator *sa, atom *a) e->card = CARD_ATOM; e->tpe = a->tpe; e->l = a; + if (!a->isnull) + set_has_no_nil(e); return e; } @@ -1875,6 +1877,9 @@ exp_is_zero(sql_exp *e) int exp_is_not_null(sql_exp *e) { + if (!has_nil(e)) + return true; + switch (e->type) { case e_atom: if (e->f) /* values list */ @@ -1907,6 +1912,9 @@ exp_is_not_null(sql_exp *e) int exp_is_null(sql_exp *e ) { + if (!has_nil(e)) + return false; + switch (e->type) { case e_atom: if (e->f) /* values list */ 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 @@ -8890,8 +8890,8 @@ rel_merge_table_rewrite(visitor *v, sql_ int skip = 0; list *exps = NULL; - /* do not include empty partitions. Don't skip when storage_based_opt is not applicable */ - if (v->storage_based_opt && pt && isTable(pt) && pt->access == TABLE_READONLY && !store_funcs.count_col(v->sql->session->tr, pt->columns.set->h->data, 1)) + /* Do not include empty partitions */ + if (pt && isTable(pt) && pt->access == TABLE_READONLY && !store_funcs.count_col(v->sql->session->tr, pt->columns.set->h->data, 1)) continue; prel = rel_rename_part(v->sql, prel, tname, t); diff --git a/sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out b/sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out --- a/sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out +++ b/sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out @@ -114,7 +114,7 @@ project ( | | | | ) [ "b2"."id" NOT NULL HASHCOL = "%3"."%3" ] | | | ) [ "b2"."increase" NOT NULL, "o"."open_auction_id" NOT NULL as "%6"."%6" ] | | ) [ "o"."open_auction_id" NOT NULL * = "%6"."%6" NOT NULL ] -| ) [ sys.sql_mul("%2"."%2" NOT NULL, double "2") <= "b2"."increase" NOT NULL ] +| ) [ sys.sql_mul("%2"."%2" NOT NULL, double "2") NOT NULL <= "b2"."increase" NOT NULL ] ) [ "b"."id" NOT NULL HASHCOL , "b"."open_auction_id" NOT NULL, "b"."date" NOT NULL, "b"."time" NOT NULL, "b"."personref" NOT NULL, "b"."increase" NOT NULL ] #Select b.* FROM open_auctions o, bidder b WHERE (select b3.INCREASE from bidder b3 where b3.id = (select min(b3a.id) from bidder b3a where b3a.open_auction_id = o.open_auction_id)) * 2 <= (Select b2.INCREASE from bidder b2 where b2.id = (SELECT MAX(b2a.id) from bidder b2a where b2a.open_auction_id = o.open_auction_id)) AND o.open_auction_id = b.open_auction_id order by date, time; % sys.b, sys.b, sys.b, sys.b, sys.b, sys.b # table_name diff --git a/sql/test/BugTracker-2015/Tests/crash_in_reduce_groupby.Bug-3818.stable.out b/sql/test/BugTracker-2015/Tests/crash_in_reduce_groupby.Bug-3818.stable.out --- a/sql/test/BugTracker-2015/Tests/crash_in_reduce_groupby.Bug-3818.stable.out +++ b/sql/test/BugTracker-2015/Tests/crash_in_reduce_groupby.Bug-3818.stable.out @@ -54,12 +54,12 @@ stdout of test 'crash_in_reduce_groupby. % .plan # table_name % rel # name % clob # type -% 180 # length +% 189 # length project ( | group by ( | | table(sys.t2a) [ "t2a"."tib0" ] COUNT -| ) [ tinyint "0" as "sora" ] [ tinyint "0" as "cods", tinyint "0" as "elrik", tinyint "0" as "ether", tinyint "0" as "jaelen", "sora", sys.min no nil ("t2a"."tib0") as "%1"."%1" ] -) [ "cods", "elrik", "ether", "jaelen", "sora", "%1"."%1" ] +| ) [ tinyint "0" as "sora" ] [ tinyint "0" as "cods", tinyint "0" as "elrik", tinyint "0" as "ether", tinyint "0" as "jaelen", "sora" NOT NULL, sys.min no nil ("t2a"."tib0") as "%1"."%1" ] +) [ "cods" NOT NULL, "elrik" NOT NULL, "ether" NOT NULL, "jaelen" NOT NULL, "sora" NOT NULL, "%1"."%1" ] #drop table t2a; #drop table t1a; diff --git a/sql/test/BugTracker-2015/Tests/quantile_function_resolution.Bug-3773.stable.out b/sql/test/BugTracker-2015/Tests/quantile_function_resolution.Bug-3773.stable.out --- a/sql/test/BugTracker-2015/Tests/quantile_function_resolution.Bug-3773.stable.out +++ b/sql/test/BugTracker-2015/Tests/quantile_function_resolution.Bug-3773.stable.out @@ -34,25 +34,25 @@ stdout of test 'quantile_function_resolu % .plan # table_name % rel # name % clob # type -% 92 # length +% 101 # length project ( | group by ( | | project ( | | | table(sys.x) [ "x"."y" ] COUNT | | ) [ "x"."y", double "0" as "%2"."%2" ] -| ) [ ] [ sys.quantile no nil (decimal(18,3)["x"."y"] as "x"."y", "%2"."%2") as "%1"."%1" ] +| ) [ ] [ sys.quantile no nil (decimal(18,3)["x"."y"] as "x"."y", "%2"."%2" NOT NULL) as "%1"."%1" ] ) [ "%1"."%1" ] #plan select quantile(y, 0) from x; % .plan # table_name % rel # name % clob # type -% 92 # length +% 101 # length project ( | group by ( | | project ( | | | table(sys.x) [ "x"."y" ] COUNT | | ) [ "x"."y", double "0" as "%2"."%2" ] -| ) [ ] [ sys.quantile no nil (decimal(18,3)["x"."y"] as "x"."y", "%2"."%2") as "%1"."%1" ] +| ) [ ] [ sys.quantile no nil (decimal(18,3)["x"."y"] as "x"."y", "%2"."%2" NOT NULL) as "%1"."%1" ] ) [ "%1"."%1" ] #rollback; diff --git a/sql/test/BugTracker-2016/Tests/memory-consumption-query-PLAN-25joins.Bug-3972.stable.out b/sql/test/BugTracker-2016/Tests/memory-consumption-query-PLAN-25joins.Bug-3972.stable.out --- a/sql/test/BugTracker-2016/Tests/memory-consumption-query-PLAN-25joins.Bug-3972.stable.out +++ b/sql/test/BugTracker-2016/Tests/memory-consumption-query-PLAN-25joins.Bug-3972.stable.out @@ -88,7 +88,7 @@ stdout of test 'memory-consumption-query % .plan # table_name % rel # name % clob # type -% 2493 # length +% 2511 # length top N ( | project ( | | select ( @@ -168,7 +168,7 @@ top N ( | | | | ) [ "a3"."t3pkcol" HASHCOL = "table1"."t1cold113" ], | | | | table(sys.table12) [ "table12"."t12cola1" ] COUNT | | | ) [ "table12"."t12cola1" = "table1"."t1cola1" ] -| | ) [ (((((((((((((((char["table1"."t1cold1"] as "table1"."t1cold1") FILTER ilike (char "%a%", char "")) or ((char["table1"."t1cola1"] as "table1"."t1cola1") FILTER ilike (char "%a%", char ""))) or ((char["table1"."t1colb1"] as "table1"."t1colb1") FILTER ilike (char "%a%", char ""))) or ((char["table1"."t1cola11"] as "table1"."t1cola11") FILTER ilike (char "%business%", char ""))) or ("table1"."t1colc91" >= timestamp(7) "2016-03-21 05:00:00.000000")) or ("table1"."t1cola101" = tinyint "1")) or ((char["table1"."t1cola12"] as "table1"."t1cola12") FILTER ilike (char "%Vijay%", char ""))) or ((char["table2"."t2cola1"] as "table2"."t2cola1") ! FILTER ilike (char "%gmail%", char ""), (char["table2"."t2cola1"] as "table2"."t2cola1") ! FILTER ilike (char "%yahoo%", char ""))) or ((char["table2"."t2cola1"] as "table2"."t2cola1") FILTER ilike (char "%efequitygroup.com%", char ""))) or ("table4"."t4cola1" = clob "Customer")) or ("table4"."t4cola2" ! * = clob "NULL")) or ("table2"."t2cola81" >= date "2009-08-31")) or ((("table5"."t5cola1" = clob "BAT") or >((char["table5"."t5cola2"] as "table5"."t5cola2") FILTER ilike (char >"%AUSTRALIA%", char ""))) or ((char["table5"."t5cola2"] as >"table5"."t5cola2") FILTER ilike (char "%Monet%", char ""), >"table5"."t5cola3" = clob "Facebook", "table5"."t5cola5" = clob "new", >"table5"."t5cola81" > date "2015-07-30"))) or ((("table10"."t10cola1" != clob >"Completed", "table9"."t9cola1" = clob "Tasks", "table9"."t9cola91" >= >timestamp(7) "2012-01-01 04:32:27.000000", "table10"."t10cola91" <= >timestamp(7) "2013-01-01 04:32:27.000000") or ("table9"."t9cola1" = clob >"Events", timestamp(7) "2012-01-01 04:32:27.000000" <= "table11"."t11cola91" ><= timestamp(7) "2013-01-01 04:32:27.000000" BETWEEN )) or >("table9"."t9cola1" = clob "Calls", timestamp(7) "2012-01-01 04:32:27.000000" ><= "table10"."t10cola91" <= timestamp(7) "2013-01-01 04:32:27.000000" BETWEEN >)), "table1"."t1cold111" in (bigint "15842000014793046" as "%2"."%2", bigint >"1584200001770 1488" as "%3"."%3", bigint "15842000000024019" as "%4"."%4", bigint "15842000000074007" as "%5"."%5", bigint "15842000009358096" as "%6"."%6", bigint "15842000010487625" as "%7"."%7", bigint "15842000006731919" as "%10"."%10", bigint "15842000002590112" as "%11"."%11", bigint "15842000000019001" as "%12"."%12", bigint "15842000014923682" as "%13"."%13", bigint "15842000027547249" as "%14"."%14")) or ("table12"."t12cola1" in (clob[bigint "15842000280111951"], clob[bigint "15842000280163015"])) ] +| | ) [ (((((((((((((((char["table1"."t1cold1"] as "table1"."t1cold1") FILTER ilike (char "%a%", char "")) or ((char["table1"."t1cola1"] as "table1"."t1cola1") FILTER ilike (char "%a%", char ""))) or ((char["table1"."t1colb1"] as "table1"."t1colb1") FILTER ilike (char "%a%", char ""))) or ((char["table1"."t1cola11"] as "table1"."t1cola11") FILTER ilike (char "%business%", char ""))) or ("table1"."t1colc91" >= timestamp(7) "2016-03-21 05:00:00.000000")) or ("table1"."t1cola101" = tinyint "1")) or ((char["table1"."t1cola12"] as "table1"."t1cola12") FILTER ilike (char "%Vijay%", char ""))) or ((char["table2"."t2cola1"] as "table2"."t2cola1") ! FILTER ilike (char "%gmail%", char ""), (char["table2"."t2cola1"] as "table2"."t2cola1") ! FILTER ilike (char "%yahoo%", char ""))) or ((char["table2"."t2cola1"] as "table2"."t2cola1") FILTER ilike (char "%efequitygroup.com%", char ""))) or ("table4"."t4cola1" = clob "Customer")) or ("table4"."t4cola2" ! * = clob "NULL")) or ("table2"."t2cola81" >= date "2009-08-31")) or ((("table5"."t5cola1" = clob "BAT") or >((char["table5"."t5cola2"] as "table5"."t5cola2") FILTER ilike (char >"%AUSTRALIA%", char ""))) or ((char["table5"."t5cola2"] as >"table5"."t5cola2") FILTER ilike (char "%Monet%", char ""), >"table5"."t5cola3" = clob "Facebook", "table5"."t5cola5" = clob "new", >"table5"."t5cola81" > date "2015-07-30"))) or ((("table10"."t10cola1" != clob >"Completed", "table9"."t9cola1" = clob "Tasks", "table9"."t9cola91" >= >timestamp(7) "2012-01-01 04:32:27.000000", "table10"."t10cola91" <= >timestamp(7) "2013-01-01 04:32:27.000000") or ("table9"."t9cola1" = clob >"Events", timestamp(7) "2012-01-01 04:32:27.000000" <= "table11"."t11cola91" ><= timestamp(7) "2013-01-01 04:32:27.000000" BETWEEN )) or >("table9"."t9cola1" = clob "Calls", timestamp(7) "2012-01-01 04:32:27.000000" ><= "table10"."t10cola91" <= timestamp(7) "2013-01-01 04:32:27.000000" BETWEEN >)), "table1"."t1cold111" in (bigint "15842000014793046" as "%2"."%2", bigint >"1584200001770 1488" as "%3"."%3", bigint "15842000000024019" as "%4"."%4", bigint "15842000000074007" as "%5"."%5", bigint "15842000009358096" as "%6"."%6", bigint "15842000010487625" as "%7"."%7", bigint "15842000006731919" as "%10"."%10", bigint "15842000002590112" as "%11"."%11", bigint "15842000000019001" as "%12"."%12", bigint "15842000014923682" as "%13"."%13", bigint "15842000027547249" as "%14"."%14")) or ("table12"."t12cola1" in (clob[bigint "15842000280111951"] NOT NULL, clob[bigint "15842000280163015"] NOT NULL)) ] | ) [ "table1"."t1pkcol" NOT NULL HASHCOL , "table1"."t1cola82", "table2"."t2cola10", "table1"."t1cola1", "table1"."t1cola91", "a1"."t3cola1" ] [ "table2"."t2cola82" NULLS LAST ] ) [ bigint "10", bigint "0" ] #ROLLBACK; diff --git a/sql/test/SQLancer/Tests/sqlancer01.stable.out b/sql/test/SQLancer/Tests/sqlancer01.stable.out --- a/sql/test/SQLancer/Tests/sqlancer01.stable.out +++ b/sql/test/SQLancer/Tests/sqlancer01.stable.out @@ -386,7 +386,7 @@ stdout of test 'sqlancer01` in directory [ 0.189 ] [ 0.493 ] #SELECT count(*) FROM t0 WHERE (NOT (CAST((t0.c1) IS NULL AS BOOLEAN))) IS NULL; --simplified -% sys.%1 # table_name +% .%1 # table_name % %1 # name % bigint # type % 1 # length diff --git a/sql/test/Tests/keys.stable.out b/sql/test/Tests/keys.stable.out --- a/sql/test/Tests/keys.stable.out +++ b/sql/test/Tests/keys.stable.out @@ -142,13 +142,13 @@ project ( % .plan # table_name % rel # name % clob # type -% 129 # length +% 138 # length project ( | group by ( | | project ( | | | table(sys.dummyme) [ "dummyme"."a" NOT NULL HASHCOL ] COUNT -| | ) [ bigint["dummyme"."a" NOT NULL HASHCOL ] NOT NULL as "%3"."%3", sys.sql_add("%3"."%3" NOT NULL, bigint "1") as "%2"."%2" ] -| ) [ ] [ sys.count unique no nil ("%2"."%2") NOT NULL as "%1"."%1" ] +| | ) [ bigint["dummyme"."a" NOT NULL HASHCOL ] NOT NULL as "%3"."%3", sys.sql_add("%3"."%3" NOT NULL, bigint "1") NOT NULL as "%2"."%2" ] +| ) [ ] [ sys.count unique no nil ("%2"."%2" NOT NULL) NOT NULL as "%1"."%1" ] ) [ "%1"."%1" NOT NULL ] #plan select count(distinct a + b) from dummyme; % .plan # table_name diff --git a/sql/test/merge-partitions/Tests/mergepart31.stable.out b/sql/test/merge-partitions/Tests/mergepart31.stable.out --- a/sql/test/merge-partitions/Tests/mergepart31.stable.out +++ b/sql/test/merge-partitions/Tests/mergepart31.stable.out @@ -53,7 +53,7 @@ union ( | | | table(sys.second_decade) [ "second_decade"."stamp" as "splitted"."stamp" ] COUNT | | ) [ "splitted"."stamp" in (timestamp(7) "2000-01-01 00:00:00.000000" as "%2"."%2", timestamp(7) "2010-01-01 00:00:00.000000" as "%3"."%3") ] | ) [ tinyint "1" ] -) [ "%6"."%6" ] +) [ "%6"."%6" NOT NULL ] #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'); --nothing gets pruned % .plan # table_name % rel # name @@ -71,13 +71,13 @@ union ( | | | | table(sys.second_decade) [ "second_decade"."stamp" as "splitted"."stamp" ] COUNT | | | ) [ "splitted"."stamp" in (timestamp(7) "2000-02-01 00:00:00.000000" as "%2"."%2", timestamp(7) "2010-02-01 00:00:00.000000" as "%3"."%3", timestamp(7) "2020-02-01 00:00:00.000000" as "%4"."%4") ] | | ) [ tinyint "1" ] -| ) [ "%11"."%11" ], +| ) [ "%11"."%11" NOT NULL ], | project ( | | select ( | | | table(sys.third_decade) [ "third_decade"."stamp" as "splitted"."stamp" ] COUNT | | ) [ "splitted"."stamp" in (timestamp(7) "2000-02-01 00:00:00.000000" as "%2"."%2", timestamp(7) "2010-02-01 00:00:00.000000" as "%3"."%3", timestamp(7) "2020-02-01 00:00:00.000000" as "%4"."%4") ] | ) [ tinyint "1" ] -) [ "%10"."%10" ] +) [ "%10"."%10" NOT NULL ] #plan select 1 from splitted where stamp BETWEEN TIMESTAMP '2020-01-01 00:00:00' AND TIMESTAMP '2020-10-01 00:00:00'; --only third child passes % .plan # table_name % rel # name @@ -104,7 +104,7 @@ union ( | | | table(sys.second_decade) [ "second_decade"."stamp" as "splitted"."stamp" ] COUNT | | ) [ timestamp(7) "2020-01-01 00:00:00.000000" ! <= "splitted"."stamp" ! <= timestamp(7) "2020-10-01 00:00:00.000000" BETWEEN ] | ) [ tinyint "1" ] -) [ "%3"."%3" ] +) [ "%3"."%3" NOT NULL ] #plan select 1 from splitted where stamp BETWEEN TIMESTAMP '2010-01-01 00:00:00' AND TIMESTAMP '2020-03-01 00:00:00'; --first child pruned % .plan # table_name % rel # name @@ -121,7 +121,7 @@ union ( | | | table(sys.third_decade) [ "third_decade"."stamp" as "splitted"."stamp" ] COUNT | | ) [ timestamp(7) "2010-01-01 00:00:00.000000" <= "splitted"."stamp" <= timestamp(7) "2020-03-01 00:00:00.000000" BETWEEN ] | ) [ tinyint "1" ] -) [ "%3"."%3" ] +) [ "%3"."%3" NOT NULL ] #plan select 1 from splitted where stamp BETWEEN TIMESTAMP '2000-02-01 00:00:00' AND TIMESTAMP '2020-03-01 00:00:00'; --nothing gets pruned % .plan # table_name % rel # name @@ -139,13 +139,13 @@ union ( | | | | table(sys.second_decade) [ "second_decade"."stamp" as "splitted"."stamp" ] COUNT | | | ) [ timestamp(7) "2000-02-01 00:00:00.000000" <= "splitted"."stamp" <= timestamp(7) "2020-03-01 00:00:00.000000" BETWEEN ] | | ) [ tinyint "1" ] -| ) [ "%5"."%5" ], +| ) [ "%5"."%5" NOT NULL ], | project ( | | select ( | | | table(sys.third_decade) [ "third_decade"."stamp" as "splitted"."stamp" ] COUNT | | ) [ timestamp(7) "2000-02-01 00:00:00.000000" <= "splitted"."stamp" <= timestamp(7) "2020-03-01 00:00:00.000000" BETWEEN ] | ) [ tinyint "1" ] -) [ "%4"."%4" ] +) [ "%4"."%4" NOT NULL ] #plan select 1 from splitted where stamp NOT BETWEEN TIMESTAMP '2000-02-01 00:00:00' AND TIMESTAMP '2020-03-01 00:00:00'; --all children pruned % .plan # table_name % rel # name @@ -177,7 +177,7 @@ union ( | | | table(sys.third_decade) [ "third_decade"."stamp" as "splitted"."stamp" ] COUNT | | ) [ "splitted"."stamp" > timestamp(7) "2010-03-01 00:00:00.000000" ] | ) [ tinyint "1" ] -) [ "%3"."%3" ] +) [ "%3"."%3" NOT NULL ] #plan select 1 from splitted where stamp <= TIMESTAMP '2009-01-01 00:00:00'; --only first child passes % .plan # table_name % rel # name @@ -215,13 +215,13 @@ union ( | | | | table(sys.second_decade) [ "second_decade"."stamp" as "splitted"."stamp" ] COUNT | | | ) [ "splitted"."stamp" <= timestamp(7) "2020-10-01 00:00:00.000000" ] | | ) [ tinyint "1" ] -| ) [ "%5"."%5" ], +| ) [ "%5"."%5" NOT NULL ], | project ( | | select ( | | | table(sys.third_decade) [ "third_decade"."stamp" as "splitted"."stamp" ] COUNT | | ) [ "splitted"."stamp" <= timestamp(7) "2020-10-01 00:00:00.000000" ] | ) [ tinyint "1" ] -) [ "%4"."%4" ] +) [ "%4"."%4" NOT NULL ] #plan select 1 from splitted where stamp < TIMESTAMP '2000-01-01 00:00:00'; --all children pruned % .plan # table_name % rel # name @@ -288,7 +288,7 @@ union ( | | | table(sys.second_decade) [ "second_decade"."stamp" as "splitted"."stamp" ] COUNT | | ) [ timestamp(7) "2000-01-01 00:00:00.000000" <= "splitted"."stamp" < timestamp(7) "2020-01-01 00:00:00.000000" BETWEEN ] | ) [ tinyint "1" ] -) [ "%3"."%3" ] +) [ "%3"."%3" NOT NULL ] #plan select 1 from splitted where stamp > TIMESTAMP '2010-01-01 00:00:00' and stamp < TIMESTAMP '2020-01-01 00:00:00'; --only second child passes % .plan # table_name % rel # name @@ -325,7 +325,7 @@ union ( | | | table(sys.second_decade) [ "second_decade"."stamp" as "splitted"."stamp" ] COUNT | | ) [ timestamp(7) "2001-01-02 00:00:00.000000" < "splitted"."stamp" < timestamp(7) "2015-01-01 00:00:00.000000" BETWEEN ] | ) [ tinyint "1" ] -) [ "%3"."%3" ] +) [ "%3"."%3" NOT NULL ] #plan select 1 from splitted where stamp > TIMESTAMP '2010-01-01 00:00:00' and stamp < TIMESTAMP '2010-01-01 00:00:00'; --all children pruned % .plan # table_name % rel # name @@ -352,7 +352,7 @@ union ( | | | table(sys.second_decade) [ "second_decade"."stamp" as "splitted"."stamp" ] COUNT | | ) [ timestamp(7) "2009-01-01 00:00:00.000000" < "splitted"."stamp" <= timestamp(7) "2010-01-01 00:00:00.000000" BETWEEN ] | ) [ tinyint "1" ] -) [ "%3"."%3" ] +) [ "%3"."%3" NOT NULL ] #plan select 1 from splitted where stamp > TIMESTAMP '2009-01-01 00:00:00' and stamp <= TIMESTAMP '2020-01-01 00:00:00'; --nothing gets pruned % .plan # table_name % rel # name @@ -370,13 +370,13 @@ union ( | | | | table(sys.second_decade) [ "second_decade"."stamp" as "splitted"."stamp" ] COUNT | | | ) [ timestamp(7) "2009-01-01 00:00:00.000000" < "splitted"."stamp" <= timestamp(7) "2020-01-01 00:00:00.000000" BETWEEN ] | | ) [ tinyint "1" ] -| ) [ "%5"."%5" ], +| ) [ "%5"."%5" NOT NULL ], | project ( | | select ( | | | table(sys.third_decade) [ "third_decade"."stamp" as "splitted"."stamp" ] COUNT | | ) [ timestamp(7) "2009-01-01 00:00:00.000000" < "splitted"."stamp" <= timestamp(7) "2020-01-01 00:00:00.000000" BETWEEN ] | ) [ tinyint "1" ] -) [ "%4"."%4" ] +) [ "%4"."%4" NOT NULL ] #CREATE TABLE fourth_decade (stamp TIMESTAMP, val INT); #ALTER TABLE splitted ADD TABLE fourth_decade AS PARTITION FROM RANGE MINVALUE TO TIMESTAMP '2000-01-01 00:00:00'; #INSERT INTO splitted VALUES (TIMESTAMP '1999-01-01 00:00:00', 7); @@ -407,7 +407,7 @@ union ( | | | table(sys.fourth_decade) [ "fourth_decade"."stamp" as "splitted"."stamp" ] COUNT | | ) [ timestamp(7) "1999-01-01 00:00:00.000000" < "splitted"."stamp" <= timestamp(7) "2001-01-01 00:00:00.000000" BETWEEN ] | ) [ tinyint "1" ] -) [ "%3"."%3" ] +) [ "%3"."%3" NOT NULL ] #plan select 1 from splitted where stamp = TIMESTAMP '2010-01-01 00:00:00'; --only second child passes _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list