Move PartitioPruneInfo out of plan nodes into PlannedStmt
Alvaro Herrera <alvherre@alvh.no-ip.org>
Move PartitioPruneInfo out of plan nodes into PlannedStmt The planner will now add a given PartitioPruneInfo to PlannedStmt.partPruneInfos instead of directly to the Append/MergeAppend plan node. What gets set instead in the latter is an index field which points to the list element of PlannedStmt.partPruneInfos containing the PartitioPruneInfo belonging to the plan node. A later commit will make AcquireExecutorLocks() do the initial partition pruning to determine a minimal set of partitions to be locked when validating a plan tree and it will need to consult the PartitioPruneInfos referenced therein to do so. It would be better for the PartitioPruneInfos to be accessible directly than requiring a walk of the plan tree to find them, which is easier when it can be done by simply iterating over PlannedStmt.partPruneInfos. Author: Amit Langote <amitlangote09@gmail.com> Discussion: https://postgr.es/m/CA+HiwqFGkMSge6TgC9KQzde0ohpAycLQuV7ooitEEpbKB0O_mg@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/executor/execMain.c | modified | +1 −0 |
| src/backend/executor/execParallel.c | modified | +1 −0 |
| src/backend/executor/execPartition.c | modified | +17 −1 |
| src/backend/executor/execUtils.c | modified | +1 −0 |
| src/backend/executor/nodeAppend.c | modified | +3 −2 |
| src/backend/executor/nodeMergeAppend.c | modified | +3 −2 |
| src/backend/optimizer/plan/createplan.c | modified | +13 −11 |
| src/backend/optimizer/plan/planner.c | modified | +1 −0 |
| src/backend/optimizer/plan/setrefs.c | modified | +37 −30 |
| src/backend/partitioning/partprune.c | modified | +13 −6 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/executor/execPartition.h | modified | +2 −2 |
| src/include/nodes/execnodes.h | modified | +1 −0 |
| src/include/nodes/pathnodes.h | modified | +6 −0 |
| src/include/nodes/plannodes.h | modified | +10 −4 |
| src/include/partitioning/partprune.h | modified | +4 −4 |
Discussion
- generic plans and "initial" pruning 249 messages · 2021-12-25 → 2026-07-06