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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy