pgsql: pg_plan_advice: Suppress advice from unflattened set operations.

Started by Robert Haasabout 1 month ago1 messagescommitters
Jump to latest
#1Robert Haas
rhaas@postgresql.org

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: /messages/by-id/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/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(-)