pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: pg_plan_advice: Avoid miscategorizing partitionwise scans as ord 2+ messages / 1 participants [nested] [flat]
* pgsql: pg_plan_advice: Avoid miscategorizing partitionwise scans as ord @ 2026-10-08 17:00 Robert Haas <rhaas@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Robert Haas @ 2026-10-08 17:00 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org pg_plan_advice: Avoid miscategorizing partitionwise scans as ordinary. Given an Append or MergeAppend node, pgpa_build_scan needs to call pgpa_make_scan for the node's own apprelids, and also for each element of child_append_relid_sets. It did that, but it overlooked the fact that the scan type applicable to the child scans might differ from the scan type applicable to the parent scan. The problem can only occur in one direction: an RTE_SUBQUERY (Merge)Append can appear on top of a RTE_RELATION (Merge)Append, but not the reverse, so the only failure mode here is to classify a partitionwise scan of a child appendrel as PGPA_SCAN_ORDINARY rather than PGPA_SCAN_PARTITIONWISE, leading to failure to include PARTITIONWISE(something) in the generated advice string. Backpatch-through: 19 Discussion: http://postgr.es/m/CA+TgmoYYHC4i-Gpzc9-JYHqih6pOK+6LTYFiNR-PioXG1nKkOQ@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/8606fb3f449301cb6c7636eed9eecf5dd267e8fb Modified Files -------------- contrib/pg_plan_advice/expected/partitionwise.out | 52 +++++++++++++++++++++++ contrib/pg_plan_advice/pgpa_scan.c | 9 +++- contrib/pg_plan_advice/sql/partitionwise.sql | 23 ++++++++++ 3 files changed, 82 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: pg_plan_advice: Avoid miscategorizing partitionwise scans as ord @ 2026-10-08 17:00 Robert Haas <rhaas@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Robert Haas @ 2026-10-08 17:00 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org pg_plan_advice: Avoid miscategorizing partitionwise scans as ordinary. Given an Append or MergeAppend node, pgpa_build_scan needs to call pgpa_make_scan for the node's own apprelids, and also for each element of child_append_relid_sets. It did that, but it overlooked the fact that the scan type applicable to the child scans might differ from the scan type applicable to the parent scan. The problem can only occur in one direction: an RTE_SUBQUERY (Merge)Append can appear on top of a RTE_RELATION (Merge)Append, but not the reverse, so the only failure mode here is to classify a partitionwise scan of a child appendrel as PGPA_SCAN_ORDINARY rather than PGPA_SCAN_PARTITIONWISE, leading to failure to include PARTITIONWISE(something) in the generated advice string. Backpatch-through: 19 Discussion: http://postgr.es/m/CA+TgmoYYHC4i-Gpzc9-JYHqih6pOK+6LTYFiNR-PioXG1nKkOQ@mail.gmail.com Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/afadfb3496edc40fb0988edc72df2e23b178d1a0 Modified Files -------------- contrib/pg_plan_advice/expected/partitionwise.out | 52 +++++++++++++++++++++++ contrib/pg_plan_advice/pgpa_scan.c | 9 +++- contrib/pg_plan_advice/sql/partitionwise.sql | 23 ++++++++++ 3 files changed, 82 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2026-10-08 17:00 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-10-08 17:00 pgsql: pg_plan_advice: Avoid miscategorizing partitionwise scans as ord Robert Haas <rhaas@postgresql.org> 2026-10-08 17:00 pgsql: pg_plan_advice: Avoid miscategorizing partitionwise scans as ord 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