]> granicus.if.org Git - postgresql/commit
ANALYZE a_star and its children to avoid plan instability in tests.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 27 Sep 2019 15:28:25 +0000 (11:28 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 27 Sep 2019 15:28:25 +0000 (11:28 -0400)
commite40f3c7472036f5a06897a11ac79fd26ec2ccf7d
tree2c660d4841b24046e0aa4d615843d004f3bc8664
parentb34bc87030655a677b0a4d6317bfe3a6a7d10546
ANALYZE a_star and its children to avoid plan instability in tests.

We've noted certain EXPLAIN queries on these tables occasionally showing
unexpected plan choices.  This seems to happen because VACUUM sometimes
fails to update relpages/reltuples for one of these single-page tables,
due to bgwriter or checkpointer holding a pin on the lone page at just
the wrong time.  To ensure those values get set, insert explicit ANALYZE
operations on these tables after we finish populating them.  This
doesn'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, but
we 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
src/test/regress/expected/create_misc.out
src/test/regress/sql/create_misc.sql