From 22864f6e02f8fc19f6167442f13d1f917e36548e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 12 Dec 2019 13:49:54 -0500 Subject: [PATCH] Put back regression test case in a more robust form. This undoes my hurried commit 776a2c887, restoring the removed test case in a form that passes with or without force_parallel_mode = regress. It turns out that force_parallel_mode = regress simply fails to mask the Worker lines that will be produced by EXPLAIN (ANALYZE, VERBOSE). I'd say that's a bug in that feature, as its entire alleged reason for existence is to make the EXPLAIN output the same. It's certainly not a bug in the plan node pruning logic. Fortunately, this test case doesn't really need to use ANALYZE, so just drop that. Discussion: https://postgr.es/m/18891.1576109690@sss.pgh.pa.us --- src/test/regress/expected/partition_prune.out | 13 +++++++++++++ src/test/regress/sql/partition_prune.sql | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/src/test/regress/expected/partition_prune.out b/src/test/regress/expected/partition_prune.out index bcfe21f19a3..8219abc813e 100644 --- a/src/test/regress/expected/partition_prune.out +++ b/src/test/regress/expected/partition_prune.out @@ -3161,6 +3161,19 @@ execute mt_q1(35); (0 rows) deallocate mt_q1; +prepare mt_q2 (int) as select * from ma_test where a >= $1 order by b limit 1; +-- Ensure output list looks sane when the MergeAppend has no subplans. +explain (verbose, costs off) execute mt_q2 (35); + QUERY PLAN +-------------------------------- + Limit + Output: ma_test.a, ma_test.b + -> Merge Append + Sort Key: ma_test.b + Subplans Removed: 3 +(5 rows) + +deallocate mt_q2; -- ensure initplan params properly prune partitions explain (analyze, costs off, summary off, timing off) select * from ma_test where a >= (select min(b) from ma_test_p2) order by b; QUERY PLAN diff --git a/src/test/regress/sql/partition_prune.sql b/src/test/regress/sql/partition_prune.sql index 825dedb5f07..61ef6e637e4 100644 --- a/src/test/regress/sql/partition_prune.sql +++ b/src/test/regress/sql/partition_prune.sql @@ -838,6 +838,13 @@ execute mt_q1(35); deallocate mt_q1; +prepare mt_q2 (int) as select * from ma_test where a >= $1 order by b limit 1; + +-- Ensure output list looks sane when the MergeAppend has no subplans. +explain (verbose, costs off) execute mt_q2 (35); + +deallocate mt_q2; + -- ensure initplan params properly prune partitions explain (analyze, costs off, summary off, timing off) select * from ma_test where a >= (select min(b) from ma_test_p2) order by b;