Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Stabilize contrib/seg regression test.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 7 Jun 2021 18:52:42 +0000 (14:52 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 7 Jun 2021 18:52:56 +0000 (14:52 -0400)
If autovacuum comes along just after we fill table test_seg with
some data, it will update the stats to the point where we prefer
a plain indexscan over a bitmap scan, breaking the expected
output (as well as the point of the test case).  To fix, just
force a bitmap scan to be chosen here.

This has evidently been wrong since commit de1d042f5.  It's not
clear why we just recently saw any buildfarm failures due to it;
but prairiedog has failed twice on this test in the past week.
Hence, backpatch to v11 where this test case came in.

contrib/seg/expected/seg.out
contrib/seg/sql/seg.sql

index 80b0bca15687edbca20d3d09df196c572a92ecc7..e617dd7e29965f1d3eb85845c70a80d8f2ebc26d 100644 (file)
@@ -930,6 +930,7 @@ SELECT '1'::seg <@ '-1 .. 1'::seg AS bool;
 CREATE TABLE test_seg (s seg);
 \copy test_seg from 'data/test_seg.data'
 CREATE INDEX test_seg_ix ON test_seg USING gist (s);
+SET enable_indexscan = false;
 EXPLAIN (COSTS OFF)
 SELECT count(*) FROM test_seg WHERE s @> '11..11.3';
                       QUERY PLAN                       
@@ -947,6 +948,7 @@ SELECT count(*) FROM test_seg WHERE s @> '11..11.3';
    143
 (1 row)
 
+RESET enable_indexscan;
 SET enable_bitmapscan = false;
 EXPLAIN (COSTS OFF)
 SELECT count(*) FROM test_seg WHERE s @> '11..11.3';
index 1d7bad7c37640c9332e60dbcbb0eff33d4b98663..6fe33e90e4e5abbb65a0900eb0e86faaf8c7fbb9 100644 (file)
@@ -217,9 +217,11 @@ CREATE TABLE test_seg (s seg);
 
 CREATE INDEX test_seg_ix ON test_seg USING gist (s);
 
+SET enable_indexscan = false;
 EXPLAIN (COSTS OFF)
 SELECT count(*) FROM test_seg WHERE s @> '11..11.3';
 SELECT count(*) FROM test_seg WHERE s @> '11..11.3';
+RESET enable_indexscan;
 
 SET enable_bitmapscan = false;
 EXPLAIN (COSTS OFF)