Generalize ri_RootToPartitionMap to use for non-partition children
Alvaro Herrera <alvherre@alvh.no-ip.org>
Generalize ri_RootToPartitionMap to use for non-partition children ri_RootToPartitionMap is currently only initialized for tuple routing target partitions, though a future commit will need the ability to use it even for the non-partition child tables, so make adjustments to the decouple it from the partitioning code. Also, make it lazily initialized via ExecGetRootToChildMap(), making that function its preferred access path. Existing third-party code accessing it directly should no longer do so; consequently, it's been renamed to ri_RootToChildMap, which also makes it consistent with ri_ChildToRootMap. ExecGetRootToChildMap() houses the logic of setting the map appropriately depending on whether a given child relation is partition or not. To support this, also add a separate entry point for TupleConversionMap creation that receives an AttrMap. No new code here, just split an existing function in two. Author: Amit Langote <amitlangote09@gmail.com> Discussion: https://postgr.es/m/CA+HiwqEYUhDXSK5BTvG_xk=eaAEJCD4GS3C6uH7ybBvv+Z_Tmg@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/common/tupconvert.c | modified | +17 −2 |
| src/backend/commands/copyfrom.c | modified | +1 −1 |
| src/backend/executor/execMain.c | modified | +5 −3 |
| src/backend/executor/execPartition.c | modified | +9 −18 |
| src/backend/executor/execUtils.c | modified | +48 −9 |
| src/backend/executor/nodeModifyTable.c | modified | +1 −1 |
| src/backend/replication/logical/worker.c | modified | +2 −2 |
| src/include/access/tupconvert.h | modified | +3 −0 |
| src/include/executor/executor.h | modified | +1 −0 |
| src/include/nodes/execnodes.h | modified | +17 −13 |
Discussion
- ExecRTCheckPerms() and many prunable partitions 97 messages · 2021-06-30 → 2023-06-30