From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_plan_advice: Fix multiple problems with NO_GATHER advice.
Date: Wed, 28 Oct 2026 19:33:03 +0000
Message-ID: <E1xM9OR-000000019a0-14CZ@gemulon.postgresql.org> (raw)
pg_plan_advice: Fix multiple problems with NO_GATHER advice.
First, the documentation describes NO_GATHER in a way that suggests
that it should both suppress partial path generation and also prohibit
the placement of Gather and Gather Merge within a join problem, but in
fact it only did the latter. Change it to do the former as well. Like
commit f71a9969d58e3e70239fc51bbeae668db973b265, this is fallout from
my failure to realize everything that needed to be changed when I
abandoned the idea of clearing consider_parallel as a way to suppress
parallel paths.
Second, emit NO_GATHER advice for the non-partial children of a
Parallel Append, because we want exactly the behaviors described
above for that case. In order to reproduce the Parallel Append, we'll
need an entirely non-parallel path for that child.
Third, update the documentation to be more precise about what happens
when NO_GATHER is applied to a child table. I believe I intended this
to work in the way described in the first paragraph above, but because
of the omission noted there, it had no effect at all. Moreover, the
documentation described the two different effects of NO_GATHER as if
subqueries were the only relevant case, but partitioning or table
inheritance gives rise to similar effects, so clarify accordingly.
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
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/3269ccc961189572ebd8cff4742461ed0d172105
Modified Files
--------------
contrib/pg_plan_advice/expected/gather.out | 129 +++++++++++++++++++++++++++++
contrib/pg_plan_advice/pgpa_planner.c | 101 ++++++++++++++++++++++
contrib/pg_plan_advice/pgpa_walker.c | 20 ++++-
contrib/pg_plan_advice/sql/gather.sql | 37 +++++++++
doc/src/sgml/pgplanadvice.sgml | 13 ++-
src/tools/pgindent/typedefs.list | 1 +
6 files changed, 297 insertions(+), 4 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: Fix multiple problems with NO_GATHER advice.
In-Reply-To: <E1xM9OR-000000019a0-14CZ@gemulon.postgresql.org>
References: <E1xM9OR-000000019a0-14CZ@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