Fix plan instability in the new tuplesort test.
authorAndres Freund <andres@anarazel.de>
Thu, 14 Nov 2019 00:36:31 +0000 (16:36 -0800)
committerAndres Freund <andres@anarazel.de>
Thu, 14 Nov 2019 00:36:31 +0000 (16:36 -0800)
At least buildfarm member florican doesn't use a material node above a
sort in the mark/restore case. As material is not intended to be
tested with that query, disallow.

src/test/regress/expected/tuplesort.out
src/test/regress/sql/tuplesort.sql

index dc30869e193f949a3ae1e71f65d413b8b2442c5a..0a2fef95ce135f653bb44f705e1db41bed144ed8 100644 (file)
@@ -603,6 +603,7 @@ INSERT INTO test_mark_restore(col1, col2, col12)
 BEGIN;
 SET LOCAL enable_nestloop = off;
 SET LOCAL enable_hashjoin = off;
+SET LOCAL enable_material = off;
 -- set query into variable once, to avoid repetition of the fairly long query
 SELECT $$
     SELECT col12, count(distinct a.col1), count(distinct a.col2), count(distinct b.col1), count(distinct b.col2), count(*)
@@ -664,11 +665,10 @@ EXPLAIN (COSTS OFF) :qry;
                      ->  Sort
                            Sort Key: a.col12 DESC
                            ->  Seq Scan on test_mark_restore a
-                     ->  Materialize
-                           ->  Sort
-                                 Sort Key: b.col12 DESC
-                                 ->  Seq Scan on test_mark_restore b
-(15 rows)
+                     ->  Sort
+                           Sort Key: b.col12 DESC
+                           ->  Seq Scan on test_mark_restore b
+(14 rows)
 
 :qry;
  col12 | count | count | count | count | count 
index 0181e9d99a82670a70f91d585c292ef739819601..6b91014a6b883017774c182d43493762158afde8 100644 (file)
@@ -275,6 +275,7 @@ BEGIN;
 
 SET LOCAL enable_nestloop = off;
 SET LOCAL enable_hashjoin = off;
+SET LOCAL enable_material = off;
 
 -- set query into variable once, to avoid repetition of the fairly long query
 SELECT $$