postgresql/src
Amit Langote bb3ec16e14 Move PartitionPruneInfo out of plan nodes into PlannedStmt
This moves PartitionPruneInfo from plan nodes to PlannedStmt,
simplifying traversal by centralizing all PartitionPruneInfo
structures in a single list in it, which holds all instances for the
main query and its subqueries. Instead of plan nodes (Append or
MergeAppend) storing PartitionPruneInfo pointers, they now reference
an index in this list.

A bitmapset field is added to PartitionPruneInfo to store the RT
indexes corresponding to the apprelids field in Append or MergeAppend.
This allows execution pruning logic to verify that it operates on the
correct plan node, mainly to facilitate debugging.

Duplicated code in set_append_references() and
set_mergeappend_references() is refactored into a new function,
register_pruneinfo(). This updates RT indexes by applying rtoffet
and adds PartitionPruneInfo to the global list in PlannerGlobal.

By allowing pruning to be performed without traversing the plan tree,
this change lays the groundwork for runtime initial pruning to occur
independently of plan tree initialization.

Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org> (earlier version)
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Reviewed-by: Tomas Vondra <tomas@vondra.me>
Discussion: https://postgr.es/m/CA+HiwqFGkMSge6TgC9KQzde0ohpAycLQuV7ooitEEpbKB0O_mg@mail.gmail.com
2025-01-30 11:57:32 +09:00
..
backend Move PartitionPruneInfo out of plan nodes into PlannedStmt 2025-01-30 11:57:32 +09:00
bin Avoid breaking SJIS encoding while de-backslashing Windows paths. 2025-01-29 14:24:36 -05:00
common Add support for Unicode case folding. 2025-01-23 09:06:50 -08:00
fe_utils Fix grammatical typos around possessive "its" 2025-01-29 14:39:14 +07:00
include Move PartitionPruneInfo out of plan nodes into PlannedStmt 2025-01-30 11:57:32 +09:00
interfaces Test ECPG decadd(), decdiv(), decmul(), and decsub() for risnull() input. 2025-01-25 11:28:14 -08:00
makefiles Update copyright for 2025 2025-01-01 11:21:55 -05:00
pl Fix grammatical typos around possessive "its" 2025-01-29 14:39:14 +07:00
port Avoid breaking SJIS encoding while de-backslashing Windows paths. 2025-01-29 14:24:36 -05:00
template thread-safety: gmtime_r(), localtime_r() 2024-08-23 07:43:04 +02:00
test Fix grammatical typos around possessive "its" 2025-01-29 14:39:14 +07:00
timezone Update time zone data files to tzdata release 2025a. 2025-01-20 16:49:15 -05:00
tools Change publication's publish_generated_columns option type to enum. 2025-01-23 15:28:37 +05:30
tutorial Doc: simplify the tutorial's window-function examples. 2025-01-21 14:43:21 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Convert sepgsql tests to TAP 2025-01-24 12:39:47 +01:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00