postgresql/src/include
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 At update of non-LP_NORMAL TID, fail instead of corrupting page header. 2025-01-25 11:28:14 -08: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 Change publication's publish_generated_columns option type to enum. 2025-01-23 15:28:37 +05:30
common Revert "Speed up tail processing when hashing aligned C strings, take two" 2025-01-29 13:35:43 +07:00
datatype Avoid using timezone Asia/Manila in regression tests. 2025-01-20 15:47:53 -05:00
executor Move PartitionPruneInfo out of plan nodes into PlannedStmt 2025-01-30 11:57:32 +09:00
fe_utils Update copyright for 2025 2025-01-01 11:21:55 -05:00
foreign Update copyright for 2025 2025-01-01 11:21:55 -05:00
jit Fix grammatical typos around possessive "its" 2025-01-29 14:39:14 +07:00
lib Add new StringInfo APIs to allow callers to specify the buffer size. 2025-01-11 08:23:46 +09:00
libpq postgres_fdw: SCRAM authentication pass-through 2025-01-15 17:58:05 +01:00
mb Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodes Move PartitionPruneInfo out of plan nodes into PlannedStmt 2025-01-30 11:57:32 +09:00
optimizer Add OLD/NEW support to RETURNING in DML queries. 2025-01-16 14:57:35 +00:00
parser Handle default NULL insertion a little better. 2025-01-29 15:31:55 -05:00
partitioning Move PartitionPruneInfo out of plan nodes into PlannedStmt 2025-01-30 11:57:32 +09:00
pch Update copyright for 2025 2025-01-01 11:21:55 -05:00
port Fix comment about AVX-512 popcount support. 2025-01-22 14:11:37 -06:00
portability Update copyright for 2025 2025-01-01 11:21:55 -05:00
postmaster Allow changing autovacuum_max_workers without restarting. 2025-01-06 15:01:22 -06:00
regex Update copyright for 2025 2025-01-01 11:21:55 -05:00
replication Return yyparse() result not via global variable 2025-01-24 06:55:39 +01:00
rewrite Add OLD/NEW support to RETURNING in DML queries. 2025-01-16 14:57:35 +00:00
snowball Update copyright for 2025 2025-01-01 11:21:55 -05:00
statistics Update copyright for 2025 2025-01-01 11:21:55 -05:00
storage Change shutdown sequence to terminate checkpointer last 2025-01-25 11:37:13 -05:00
tcop Update copyright for 2025 2025-01-01 11:21:55 -05:00
tsearch Update copyright for 2025 2025-01-01 11:21:55 -05:00
utils Add SQL function CASEFOLD(). 2025-01-24 14:56:22 -08:00
.gitignore Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
c.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
fmgr.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
funcapi.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
getopt_long.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
Makefile Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
miscadmin.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_config.h.in Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
pg_config_manual.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_getopt.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
pg_trace.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
pgstat.h Track per-relation cumulative time spent in [auto]vacuum and [auto]analyze 2025-01-28 09:57:32 +09:00
pgtar.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pgtime.h Seek zone abbreviations in the IANA data before timezone_abbreviations. 2025-01-16 14:11:19 -05:00
port.h Avoid breaking SJIS encoding while de-backslashing Windows paths. 2025-01-29 14:24:36 -05:00
postgres.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
postgres_ext.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
postgres_fe.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
varatt.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
windowapi.h Update copyright for 2025 2025-01-01 11:21:55 -05:00