pgsql: pg_plan_advice: Suppress advice from unflattened set operations.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_plan_advice: Suppress advice from unflattened set operations.
Date: 2026-10-29 15:03:30
Message-ID: E1xMRf8-00000001GvL-110z@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)postgres(dot)ai>
Discussion: http://postgr.es/m/CA+Tgmob3X+_CSjAa_BtU9bXrX_ge_HyvO=7gSCLtBpncGwn-kQ@mail.gmail.com
Tested-by: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/04ac919fd0bfc43ccf4d29d69cdc800ad587fc39

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

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2026-10-29 15:56:49 pgsql: pg_plan_advice: Mark PARTITIONWISE inapplicable on plain rels.
Previous Message Fujii Masao 2026-10-29 14:10:16 pgsql: Reduce log verbosity during prepared transaction recovery