From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_plan_advice: Mark PARTITIONWISE inapplicable on plain rels.
Date: Thu, 29 Oct 2026 15:56:49 +0000
Message-ID: <E1xMSUj-00000001HCk-0PXh@gemulon.postgresql.org> (raw)
pg_plan_advice: Mark PARTITIONWISE inapplicable on plain rels.
Previously, such advice was accepted, and just had the effect of disabling
every path for the target relation, which isn't the worst imaginable
behavior, but it's not difficult to do better. This commit causes such
advice to instead be marked inapplicable, like INDEX_SCAN(some_table
NO_SUCH_INDEX).
One advantage of this change is that it improves the test coverage
provided by test_plan_advice. In fact, prior to commit
0f7dfd7936b9e99f9aeca00f52ab1692898ffff4, these changes caused
test_plan_advice failures, because the defect fixed by that commit
caused PARTITIONWISE advice to target the wrong relations. Without
this change, the advice feedback doesn't show any sign that there's
a problem, which is how that defect escaped discovery.
Reported-by: Nikolay Samokhvalov <nik@postgres.ai>
Discussion: http://postgr.es/m/CA+Tgmob3X+_CSjAa_BtU9bXrX_ge_HyvO=7gSCLtBpncGwn-kQ@mail.gmail.com
Tested-by: Jakub Wartak <jakub.wartak@enterprisedb.com>
Backpatch-through: 19
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/82bd4e644d669dcda98562073098594eb1eba654
Modified Files
--------------
contrib/pg_plan_advice/expected/partitionwise.out | 49 +++++++++++++++++++++++
contrib/pg_plan_advice/pgpa_planner.c | 42 ++++++++++++++++++-
contrib/pg_plan_advice/sql/partitionwise.sql | 10 +++++
3 files changed, 99 insertions(+), 2 deletions(-)
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: rhaas@postgresql.org
Subject: Re: pgsql: pg_plan_advice: Mark PARTITIONWISE inapplicable on plain rels.
In-Reply-To: <E1xMSUj-00000001HCk-0PXh@gemulon.postgresql.org>
References: <E1xMSUj-00000001HCk-0PXh@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