Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 24566b3

Browse files
committed
Attempt to fix unstable regression tests, take 2
Following up on 2dc16ef, petalura has suffered some additional failures in stats_ext which again appear to be around the timing of an autovacuum during the test, causing instability in the row estimates. Again, let's fix this by explicitly performing a VACUUM on the table and not leave it to happen by chance of an autovacuum pass. Discussion: https://postgr.es/m/CAApHDvok5hmXr%2BbUbJe7%2B2sQzWo4B_QzSk7RKFR9fP6BjYXx5g%40mail.gmail.com
1 parent 64638cc commit 24566b3

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/test/regress/expected/stats_ext.out

+5-5
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ INSERT INTO ndistinct (a, b, c, filler1)
279279
SELECT mod(i,50), mod(i,51), mod(i,32),
280280
cash_words(mod(i,33)::int::money)
281281
FROM generate_series(1,5000) s(i);
282-
ANALYZE ndistinct;
282+
VACUUM (ANALYZE) ndistinct;
283283
SELECT s.stxkind, d.stxdndistinct
284284
FROM pg_statistic_ext s, pg_statistic_ext_data d
285285
WHERE s.stxrelid = 'ndistinct'::regclass
@@ -375,7 +375,7 @@ CREATE INDEX fdeps_abc_idx ON functional_dependencies (a, b, c);
375375
-- random data (no functional dependencies)
376376
INSERT INTO functional_dependencies (a, b, c, filler1)
377377
SELECT mod(i, 23), mod(i, 29), mod(i, 31), i FROM generate_series(1,5000) s(i);
378-
ANALYZE functional_dependencies;
378+
VACUUM (ANALYZE) functional_dependencies;
379379
SELECT * FROM check_estimated_rows('SELECT * FROM functional_dependencies WHERE a = 1 AND b = ''1''');
380380
estimated | actual
381381
-----------+--------
@@ -408,7 +408,7 @@ TRUNCATE functional_dependencies;
408408
DROP STATISTICS func_deps_stat;
409409
INSERT INTO functional_dependencies (a, b, c, filler1)
410410
SELECT mod(i,100), mod(i,50), mod(i,25), i FROM generate_series(1,5000) s(i);
411-
ANALYZE functional_dependencies;
411+
VACUUM (ANALYZE) functional_dependencies;
412412
SELECT * FROM check_estimated_rows('SELECT * FROM functional_dependencies WHERE a = 1 AND b = ''1''');
413413
estimated | actual
414414
-----------+--------
@@ -741,7 +741,7 @@ SELECT * FROM check_estimated_rows('SELECT * FROM functional_dependencies WHERE
741741
25 | 50
742742
(1 row)
743743

744-
ANALYZE functional_dependencies;
744+
VACUUM (ANALYZE) functional_dependencies;
745745
SELECT * FROM check_estimated_rows('SELECT * FROM functional_dependencies WHERE a = 1 AND b = ''1'' AND c = 1');
746746
estimated | actual
747747
-----------+--------
@@ -1398,7 +1398,7 @@ INSERT INTO mcv_lists_bool (a, b, c)
13981398
SELECT
13991399
(mod(i,2) = 0), (mod(i,4) = 0), (mod(i,8) = 0)
14001400
FROM generate_series(1,10000) s(i);
1401-
ANALYZE mcv_lists_bool;
1401+
VACUUM (ANALYZE) mcv_lists_bool;
14021402
SELECT * FROM check_estimated_rows('SELECT * FROM mcv_lists_bool WHERE a AND b AND c');
14031403
estimated | actual
14041404
-----------+--------

src/test/regress/sql/stats_ext.sql

+5-5
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ INSERT INTO ndistinct (a, b, c, filler1)
191191
cash_words(mod(i,33)::int::money)
192192
FROM generate_series(1,5000) s(i);
193193

194-
ANALYZE ndistinct;
194+
VACUUM (ANALYZE) ndistinct;
195195

196196
SELECT s.stxkind, d.stxdndistinct
197197
FROM pg_statistic_ext s, pg_statistic_ext_data d
@@ -245,7 +245,7 @@ CREATE INDEX fdeps_abc_idx ON functional_dependencies (a, b, c);
245245
INSERT INTO functional_dependencies (a, b, c, filler1)
246246
SELECT mod(i, 23), mod(i, 29), mod(i, 31), i FROM generate_series(1,5000) s(i);
247247

248-
ANALYZE functional_dependencies;
248+
VACUUM (ANALYZE) functional_dependencies;
249249

250250
SELECT * FROM check_estimated_rows('SELECT * FROM functional_dependencies WHERE a = 1 AND b = ''1''');
251251

@@ -267,7 +267,7 @@ DROP STATISTICS func_deps_stat;
267267
INSERT INTO functional_dependencies (a, b, c, filler1)
268268
SELECT mod(i,100), mod(i,50), mod(i,25), i FROM generate_series(1,5000) s(i);
269269

270-
ANALYZE functional_dependencies;
270+
VACUUM (ANALYZE) functional_dependencies;
271271

272272
SELECT * FROM check_estimated_rows('SELECT * FROM functional_dependencies WHERE a = 1 AND b = ''1''');
273273

@@ -396,7 +396,7 @@ ALTER TABLE functional_dependencies ALTER COLUMN c TYPE numeric;
396396

397397
SELECT * FROM check_estimated_rows('SELECT * FROM functional_dependencies WHERE a = 1 AND b = ''1'' AND c = 1');
398398

399-
ANALYZE functional_dependencies;
399+
VACUUM (ANALYZE) functional_dependencies;
400400

401401
SELECT * FROM check_estimated_rows('SELECT * FROM functional_dependencies WHERE a = 1 AND b = ''1'' AND c = 1');
402402

@@ -742,7 +742,7 @@ INSERT INTO mcv_lists_bool (a, b, c)
742742
(mod(i,2) = 0), (mod(i,4) = 0), (mod(i,8) = 0)
743743
FROM generate_series(1,10000) s(i);
744744

745-
ANALYZE mcv_lists_bool;
745+
VACUUM (ANALYZE) mcv_lists_bool;
746746

747747
SELECT * FROM check_estimated_rows('SELECT * FROM mcv_lists_bool WHERE a AND b AND c');
748748

0 commit comments

Comments
 (0)