Put back regression test case in a more robust form.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 12 Dec 2019 18:49:54 +0000 (13:49 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 12 Dec 2019 18:49:54 +0000 (13:49 -0500)
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
src/test/regress/sql/partition_prune.sql

index bcfe21f19a3e8bc83515af5d3bd16f68acd54183..8219abc813eaf1d4c01c8c5695203e837cd7e0b3 100644 (file)
@@ -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                                           
index 825dedb5f074dcf9dd7e98fcc35f39d3f9762b1c..61ef6e637e49db32795cb99077f40590614f38d6 100644 (file)
@@ -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;