postgresql/src/backend
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
..
access Fix grammatical typos around possessive "its" 2025-01-29 14:39:14 +07:00
archive Update copyright for 2025 2025-01-01 11:21:55 -05:00
backup Update copyright for 2025 2025-01-01 11:21:55 -05:00
bootstrap Update copyright for 2025 2025-01-01 11:21:55 -05:00
catalog Rename pubgencols_type to pubgencols in pg_publication. 2025-01-28 10:42:46 +05:30
commands Rename pubgencols_type to pubgencols in pg_publication. 2025-01-28 10:42:46 +05:30
executor Move PartitionPruneInfo out of plan nodes into PlannedStmt 2025-01-30 11:57:32 +09:00
foreign Update copyright for 2025 2025-01-01 11:21:55 -05:00
jit Add OLD/NEW support to RETURNING in DML queries. 2025-01-16 14:57:35 +00:00
lib Update copyright for 2025 2025-01-01 11:21:55 -05:00
libpq postgres_fdw: SCRAM authentication pass-through 2025-01-15 17:58:05 +01:00
main Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodes Add OLD/NEW support to RETURNING in DML queries. 2025-01-16 14:57:35 +00:00
optimizer Move PartitionPruneInfo out of plan nodes into PlannedStmt 2025-01-30 11:57:32 +09:00
parser Require callers of coerce_to_domain() to supply base type/typmod. 2025-01-29 15:42:25 -05:00
partitioning Move PartitionPruneInfo out of plan nodes into PlannedStmt 2025-01-30 11:57:32 +09:00
po Update copyright for 2025 2025-01-01 11:21:55 -05:00
port Update copyright for 2025 2025-01-01 11:21:55 -05:00
postmaster Change shutdown sequence to terminate checkpointer last 2025-01-25 11:37:13 -05:00
regex Support PG_UNICODE_FAST locale in the builtin collation provider. 2025-01-17 15:56:30 -08:00
replication Fix grammatical typos around possessive "its" 2025-01-29 14:39:14 +07:00
rewrite Handle default NULL insertion a little better. 2025-01-29 15:31:55 -05:00
snowball Update copyright for 2025 2025-01-01 11:21:55 -05:00
statistics Consistently spell "leakproof" without a hyphen. 2025-01-14 13:50:54 +00:00
storage Make BufferIsExclusiveLocked and BufferIsDirty work for local buffers. 2025-01-29 13:23:31 -05:00
tcop Use PqMsg_* macros in postgres.c. 2025-01-07 15:34:19 -06:00
tsearch Reword recent error messages: "should" -> "must" 2025-01-21 15:24:49 +01:00
utils Fix grammatical typos around possessive "its" 2025-01-29 14:39:14 +07:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
Makefile Update copyright for 2025 2025-01-01 11:21:55 -05:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
nls.mk Return yyparse() result not via global variable 2025-01-24 06:55:39 +01:00