From c6b87f73552b3c0d1a79bb3e8380dc31d920309a Mon Sep 17 00:00:00 2001 From: Tao-Ma Date: Thu, 2 Jan 2025 17:55:38 +0800 Subject: [PATCH] FIXME: It looks like PostgreSQL planner pruning feature does not work properly The partition_pruning test stated GP6 introduced the pruning issue. Please refer the commit 3ea5477 to solve the pruning bug in PostgreSQL planner. --- .../regress/expected/partition_pruning.out | 4 ++-- src/test/regress/expected/qp_dropped_cols.out | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/test/regress/expected/partition_pruning.out b/src/test/regress/expected/partition_pruning.out index e59c30db312..4db4f0ce81d 100644 --- a/src/test/regress/expected/partition_pruning.out +++ b/src/test/regress/expected/partition_pruning.out @@ -38,9 +38,9 @@ explain select * from parttab where length(n::text) = 3; --------------------------------------------------------------------------------- Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..533.04 rows=70 width=64) -> Append (cost=0.00..532.12 rows=23 width=64) - -> Seq Scan on parttab_1_prt_one (cost=0.00..266.00 rows=12 width=64) + -> Seq Scan on parttab_1_prt_one parttab_1 (cost=0.00..266.00 rows=12 width=64) Filter: (length((n)::text) = 3) - -> Seq Scan on parttab_1_prt_two (cost=0.00..266.00 rows=12 width=64) + -> Seq Scan on parttab_1_prt_two parttab_2 (cost=0.00..266.00 rows=12 width=64) Filter: (length((n)::text) = 3) Optimizer: Postgres query optimizer (7 rows) diff --git a/src/test/regress/expected/qp_dropped_cols.out b/src/test/regress/expected/qp_dropped_cols.out index df61f4b7e65..5ef070c7167 100644 --- a/src/test/regress/expected/qp_dropped_cols.out +++ b/src/test/regress/expected/qp_dropped_cols.out @@ -14977,9 +14977,9 @@ EXPLAIN (costs off) SELECT * FROM ds_main, non_part2 WHERE ds_main.c = non_part2 QUERY PLAN --------------------------------------------------------------------------------------------------- Gather Motion 3:1 (slice1; segments: 3) - Merge Key: ds_main_1_prt_2.a + Merge Key: ds_main.a -> Sort - Sort Key: ds_main_1_prt_2.a + Sort Key: ds_main.a -> HashAggregate Group Key: (RowIdExpr) -> Redistribute Motion 3:3 (slice2; segments: 3) @@ -14987,20 +14987,20 @@ EXPLAIN (costs off) SELECT * FROM ds_main, non_part2 WHERE ds_main.c = non_part2 -> Nested Loop -> Broadcast Motion 3:3 (slice3; segments: 3) -> Hash Join - Hash Cond: (ds_main_1_prt_2.c = non_part2.e) + Hash Cond: (ds_main.c = non_part2.e) -> Append Partition Selectors: $0 - -> Seq Scan on ds_main_1_prt_2 + -> Seq Scan on ds_main_1_prt_2 ds_main_1 Filter: (a IS NOT NULL) - -> Seq Scan on ds_main_1_prt_3 + -> Seq Scan on ds_main_1_prt_3 ds_main_2 Filter: (a IS NOT NULL) - -> Seq Scan on ds_main_1_prt_4 + -> Seq Scan on ds_main_1_prt_4 ds_main_3 Filter: (a IS NOT NULL) - -> Seq Scan on ds_main_1_prt_5 + -> Seq Scan on ds_main_1_prt_5 ds_main_4 Filter: (a IS NOT NULL) - -> Seq Scan on ds_main_1_prt_6 + -> Seq Scan on ds_main_1_prt_6 ds_main_5 Filter: (a IS NOT NULL) - -> Seq Scan on ds_main_1_prt_deflt + -> Seq Scan on ds_main_1_prt_deflt ds_main_6 Filter: (a IS NOT NULL) -> Hash -> Partition Selector (selector id: $0)