]> granicus.if.org Git - postgresql/commitdiff
Stabilize results of brin regression test.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 4 Jun 2015 17:46:34 +0000 (13:46 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 4 Jun 2015 17:46:34 +0000 (13:46 -0400)
This test used seqscans on tenk1, with LIMIT, to build test data.
That works most of the time, but if the synchronized-seqscan logic
kicks in, we get varying test data.  This seems likely to explain
the erratic test failures on buildfarm member chipmunk, which uses
smaller-than-default shared_buffers.  To fix, add ORDER BY clauses to
force the ordering to be what it was implicitly being assumed to be.

Peter Geoghegan had noticed this with respect to one of the trouble
spots, though not the ones actually causing the chipmunk issue.

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

index 2be4b7ca3f6fb6d8c1f8b8f6a9b098044779a39e..ba0824428ec2423579504ee6c17738081cb66e7e 100644 (file)
@@ -55,13 +55,13 @@ INSERT INTO brintest SELECT
        int4range(thousand, twothousand),
        format('%s/%s%s', odd, even, tenthous)::pg_lsn,
        box(point(odd, even), point(thousand, twothousand))
-FROM tenk1 LIMIT 100;
+FROM tenk1 ORDER BY unique2 LIMIT 100;
 -- throw in some NULL's and different values
 INSERT INTO brintest (inetcol, cidrcol, int4rangecol) SELECT
        inet 'fe80::6e40:8ff:fea9:8c46' + tenthous,
        cidr 'fe80::6e40:8ff:fea9:8c46' + tenthous,
        'empty'::int4range
-FROM tenk1 LIMIT 25;
+FROM tenk1 ORDER BY thousand, tenthous LIMIT 25;
 CREATE INDEX brinidx ON brintest USING brin (
        byteacol,
        charcol,
@@ -238,7 +238,7 @@ INSERT INTO brintest SELECT
        int4range(thousand, twothousand),
        format('%s/%s%s', odd, even, tenthous)::pg_lsn,
        box(point(odd, even), point(thousand, twothousand))
-FROM tenk1 LIMIT 5 OFFSET 5;
+FROM tenk1 ORDER BY unique2 LIMIT 5 OFFSET 5;
 VACUUM brintest;  -- force a summarization cycle in brinidx
 UPDATE brintest SET int8col = int8col * int4col;
 UPDATE brintest SET textcol = '' WHERE textcol IS NOT NULL;
index f47ef04c439872684c1f30e6bfc7fbb168549103..881a13b1b0b3f85c38a5386c9fdbf529f7d92e21 100644 (file)
@@ -56,14 +56,14 @@ INSERT INTO brintest SELECT
        int4range(thousand, twothousand),
        format('%s/%s%s', odd, even, tenthous)::pg_lsn,
        box(point(odd, even), point(thousand, twothousand))
-FROM tenk1 LIMIT 100;
+FROM tenk1 ORDER BY unique2 LIMIT 100;
 
 -- throw in some NULL's and different values
 INSERT INTO brintest (inetcol, cidrcol, int4rangecol) SELECT
        inet 'fe80::6e40:8ff:fea9:8c46' + tenthous,
        cidr 'fe80::6e40:8ff:fea9:8c46' + tenthous,
        'empty'::int4range
-FROM tenk1 LIMIT 25;
+FROM tenk1 ORDER BY thousand, tenthous LIMIT 25;
 
 CREATE INDEX brinidx ON brintest USING brin (
        byteacol,
@@ -245,7 +245,7 @@ INSERT INTO brintest SELECT
        int4range(thousand, twothousand),
        format('%s/%s%s', odd, even, tenthous)::pg_lsn,
        box(point(odd, even), point(thousand, twothousand))
-FROM tenk1 LIMIT 5 OFFSET 5;
+FROM tenk1 ORDER BY unique2 LIMIT 5 OFFSET 5;
 
 VACUUM brintest;  -- force a summarization cycle in brinidx