pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: ANALYZE a_star and its children to avoid plan instability in tes
Date: Fri, 27 Sep 2019 15:28:34 +0000
Message-ID: <E1iDsAc-0004mW-0S@gemulon.postgresql.org> (raw)

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

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e40f3c7472036f5a06897a11ac79fd26ec2ccf7d

Modified Files
--------------
src/test/regress/expected/create_misc.out | 7 +++++++
src/test/regress/sql/create_misc.sql      | 8 ++++++++
2 files changed, 15 insertions(+)



view thread (2+ messages)

Message-ID: <E1iDsAc-0004mW-0S@gemulon.postgresql.org>
Permalink:  ../E1iDsAc-0004mW-0S@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iDsAc-0004mW-0S@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: ANALYZE a_star and its children to avoid plan instability in tes
  In-Reply-To: <E1iDsAc-0004mW-0S@gemulon.postgresql.org>
  References: <E1iDsAc-0004mW-0S@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox