diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/regress/expected/partition_prune.out | 56 | ||||
-rw-r--r-- | src/test/regress/sql/partition_prune.sql | 7 |
2 files changed, 53 insertions, 10 deletions
diff --git a/src/test/regress/expected/partition_prune.out b/src/test/regress/expected/partition_prune.out index b41950d923b..bf0657b9f2c 100644 --- a/src/test/regress/expected/partition_prune.out +++ b/src/test/regress/expected/partition_prune.out @@ -1093,16 +1093,11 @@ explain (costs off) select * from boolpart where a is not true and a is not fals (2 rows) explain (costs off) select * from boolpart where a is unknown; - QUERY PLAN ------------------------------------------------ - Append - -> Seq Scan on boolpart_f boolpart_1 - Filter: (a IS UNKNOWN) - -> Seq Scan on boolpart_t boolpart_2 - Filter: (a IS UNKNOWN) - -> Seq Scan on boolpart_default boolpart_3 - Filter: (a IS UNKNOWN) -(7 rows) + QUERY PLAN +--------------------------------------- + Seq Scan on boolpart_default boolpart + Filter: (a IS UNKNOWN) +(2 rows) explain (costs off) select * from boolpart where a is not unknown; QUERY PLAN @@ -1200,6 +1195,18 @@ explain (costs off) select * from boolpart where a is not false; Filter: (a IS NOT FALSE) (5 rows) +explain (costs off) select * from boolpart where a is not unknown; + QUERY PLAN +----------------------------------------------- + Append + -> Seq Scan on boolpart_f boolpart_1 + Filter: (a IS NOT UNKNOWN) + -> Seq Scan on boolpart_t boolpart_2 + Filter: (a IS NOT UNKNOWN) + -> Seq Scan on boolpart_default boolpart_3 + Filter: (a IS NOT UNKNOWN) +(7 rows) + select * from boolpart where a is not true; a --- @@ -1220,6 +1227,35 @@ select * from boolpart where a is not false; (2 rows) +select * from boolpart where a is not unknown; + a +--- + f + t +(2 rows) + +-- check that all partitions are pruned when faced with conflicting clauses +explain (costs off) select * from boolpart where a is not unknown and a is unknown; + QUERY PLAN +-------------------------- + Result + One-Time Filter: false +(2 rows) + +explain (costs off) select * from boolpart where a is false and a is unknown; + QUERY PLAN +-------------------------- + Result + One-Time Filter: false +(2 rows) + +explain (costs off) select * from boolpart where a is true and a is unknown; + QUERY PLAN +-------------------------- + Result + One-Time Filter: false +(2 rows) + -- inverse boolean partitioning - a seemingly unlikely design, but we've got -- code for it, so we'd better test it. create table iboolpart (a bool) partition by list ((not a)); diff --git a/src/test/regress/sql/partition_prune.sql b/src/test/regress/sql/partition_prune.sql index 7ba6a9ff370..a09b27d820c 100644 --- a/src/test/regress/sql/partition_prune.sql +++ b/src/test/regress/sql/partition_prune.sql @@ -186,10 +186,17 @@ insert into boolpart values(null); explain (costs off) select * from boolpart where a is not true; explain (costs off) select * from boolpart where a is not true and a is not false; explain (costs off) select * from boolpart where a is not false; +explain (costs off) select * from boolpart where a is not unknown; select * from boolpart where a is not true; select * from boolpart where a is not true and a is not false; select * from boolpart where a is not false; +select * from boolpart where a is not unknown; + +-- check that all partitions are pruned when faced with conflicting clauses +explain (costs off) select * from boolpart where a is not unknown and a is unknown; +explain (costs off) select * from boolpart where a is false and a is unknown; +explain (costs off) select * from boolpart where a is true and a is unknown; -- inverse boolean partitioning - a seemingly unlikely design, but we've got -- code for it, so we'd better test it. |