Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb9bffa0

Browse files
committed
ANALYZE a_star and its children to avoid plan instability in tests.
We've noted certain EXPLAIN queries on these tables occasionally showingunexpected plan choices. This seems to happen because VACUUM sometimesfails to update relpages/reltuples for one of these single-page tables,due to bgwriter or checkpointer holding a pin on the lone page at justthe wrong time. To ensure those values get set, insert explicit ANALYZEoperations on these tables after we finish populating them. Thisdoesn't seem to affect any other test cases, so it's a usable fix.Back-patch to v12. In principle the issue exists further back, butwe have not seen it before v12, so I won't risk back-patching further.Discussion:https://postgr.es/m/24480.1569518042@sss.pgh.pa.us
1 parentd9cacca commitb9bffa0

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

‎src/test/regress/expected/create_misc.out

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ INSERT INTO f_star (class, e) VALUES ('f', '-12'::int2);
130130
INSERT INTO f_star (class, f)
131131
VALUES ('f', '(11111111,33333333),(22222222,44444444)'::polygon);
132132
INSERT INTO f_star (class) VALUES ('f');
133+
-- Analyze the X_star tables for better plan stability in later tests
134+
ANALYZE a_star;
135+
ANALYZE b_star;
136+
ANALYZE c_star;
137+
ANALYZE d_star;
138+
ANALYZE e_star;
139+
ANALYZE f_star;
133140
--
134141
-- for internal portal (cursor) tests
135142
--

‎src/test/regress/sql/create_misc.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@ INSERT INTO f_star (class, f)
192192

193193
INSERT INTO f_star (class)VALUES ('f');
194194

195+
-- Analyze the X_star tables for better plan stability in later tests
196+
ANALYZE a_star;
197+
ANALYZE b_star;
198+
ANALYZE c_star;
199+
ANALYZE d_star;
200+
ANALYZE e_star;
201+
ANALYZE f_star;
202+
195203

196204
--
197205
-- for internal portal (cursor) tests

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp