Skip to content

Commit c588df9

Browse files
committed
Make psql_crosstab plans more stable
To achieve this, ANALYZE the data table before querying it, as suggested by Tom Lane. On my system, this enables the test to pass with 128 kB of work_mem (a value with which other tests fail -- so it seems good enough). Reported by Michaël Paquier.
1 parent 736c95c commit c588df9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/test/regress/expected/psql_crosstab.out

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ VALUES
1010
('v0','h4','dbl', -3, '2014-12-15'),
1111
('v0',NULL,'qux', 5, '2014-07-15'),
1212
('v1','h2','quux',7, '2015-04-04');
13+
-- make plans more stable
14+
ANALYZE ctv_data;
1315
-- running \crosstabview after query uses query in buffer
1416
SELECT v, EXTRACT(year FROM d), count(*)
1517
FROM ctv_data

src/test/regress/sql/psql_crosstab.sql

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ VALUES
1212
('v0',NULL,'qux', 5, '2014-07-15'),
1313
('v1','h2','quux',7, '2015-04-04');
1414

15+
-- make plans more stable
16+
ANALYZE ctv_data;
17+
1518
-- running \crosstabview after query uses query in buffer
1619
SELECT v, EXTRACT(year FROM d), count(*)
1720
FROM ctv_data

0 commit comments

Comments
 (0)