pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Re-adjust drop-index-concurrently-1 isolation test
Date: Thu, 15 Dec 2022 22:40:45 +0000
Message-ID: <E1p5wuC-003mGt-NT@gemulon.postgresql.org> (raw)

Re-adjust drop-index-concurrently-1 isolation test

It seems that drop-index-concurrently-1 has started to forget what it was
originally meant to be testing.  d2d8a229b, which added incremental sorts
changed the expected plan to be an Index Scan plan instead of a Seq Scan
plan.  This occurred as the primary key index of the table in question
provided presorted input and, because that index happened to be the
cheapest input path due to enable_seqscan being disabled, the incremental
sort changes just added a Sort on top of that.  It seems based on the name
of the PREPAREd statement that the intention here is that the query
produces a seqscan plan.

The reason this test has become broken seems to be due to how the test was
originally coded.  The test was trying to force a seqscan plan by
performing some casting to make it so the test_dc index couldn't be used
to perform the required filtering.  Trying to coax the planner into using
a plan which has costed in a disable_cost seems like it's always going to
be flakey as small changes in costs are drowned out by the large
disable_cost combined with add_path's STD_FUZZ_FACTOR.  Here we get rid of
the casts that we're using to try to trick the planner into a seqscan and
instead toggle enable_seqscan as and when required to get the desired
plan.

Additionally, rename a few things in the test and add some additional
wording to the comments to try and make it more clear in the future what
we expect this test to be doing.

Discussion: https://postgr.es/m/CAApHDvrbDhObhLV+=U_K_-t+2Av2av1aL9d+2j_3AO-XndaviA@mail.gmail.com
Backpatch-through: 13, where d2d8a229b changed the expected test output

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1a9b43c688da9bbb13f0cb07d4b4c03abf1518b5

Modified Files
--------------
.../expected/drop-index-concurrently-1.out         | 31 +++++++++++-----------
.../expected/drop-index-concurrently-1_2.out       | 31 +++++++++++-----------
.../isolation/specs/drop-index-concurrently-1.spec | 22 ++++++++-------
3 files changed, 44 insertions(+), 40 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1p5wuC-003mGt-NT@gemulon.postgresql.org>
Permalink:  ../E1p5wuC-003mGt-NT@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1p5wuC-003mGt-NT@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: drowley@postgresql.org
  Subject: Re: pgsql: Re-adjust drop-index-concurrently-1 isolation test
  In-Reply-To: <E1p5wuC-003mGt-NT@gemulon.postgresql.org>
  References: <E1p5wuC-003mGt-NT@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