pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: pg_plan_advice: Fix multiple problems with NO_GATHER advice.
2+ messages / 1 participants
[nested] [flat]

* pgsql: pg_plan_advice: Fix multiple problems with NO_GATHER advice.
@ 2026-10-28 19:33  Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Robert Haas @ 2026-10-28 19:33 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: pg_plan_advice: Fix multiple problems with NO_GATHER advice.
@ 2026-10-28 19:33  Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Robert Haas @ 2026-10-28 19:33 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4fdfdaf638acc1a080768338e31862cf1716d5a6

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(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-10-28 19:33 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-10-28 19:33 pgsql: pg_plan_advice: Fix multiple problems with NO_GATHER advice. Robert Haas <rhaas@postgresql.org>
2026-10-28 19:33 pgsql: pg_plan_advice: Fix multiple problems with NO_GATHER advice. Robert Haas <rhaas@postgresql.org>

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