From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_plan_advice: Suppress advice from unflattened set operations.
Date: Thu, 29 Oct 2026 15:03:30 +0000
Message-ID: <E1xMRf8-00000001GvJ-0wOE@gemulon.postgresql.org> (raw)
pg_plan_advice: Suppress advice from unflattened set operations.
Previously, we could generate GATHER, GATHER_MERGE, or NO_GATHER
advice for portions of the plan tree generated by set operation
planning. There are no upper-planner hooks we can use to enforce
such advice, so we shouldn't generate it, either. Make it so, and
also add a bunch of test cases to verify the behavior.
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
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/a054b77e40d0579a9ee1218e2447d5af045d1083
Modified Files
--------------
contrib/pg_plan_advice/expected/gather.out | 165 ++++++++++++++++++++++++++---
contrib/pg_plan_advice/pgpa_join.c | 4 +-
contrib/pg_plan_advice/pgpa_scan.c | 92 +++++++++++++---
contrib/pg_plan_advice/pgpa_scan.h | 4 +-
contrib/pg_plan_advice/pgpa_walker.c | 135 +++++++++++++----------
contrib/pg_plan_advice/pgpa_walker.h | 4 +-
contrib/pg_plan_advice/sql/gather.sql | 54 ++++++++++
7 files changed, 374 insertions(+), 84 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: Suppress advice from unflattened set operations.
In-Reply-To: <E1xMRf8-00000001GvJ-0wOE@gemulon.postgresql.org>
References: <E1xMRf8-00000001GvJ-0wOE@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