mirror of
https://github.com/postgres/postgres.git
synced 2025-10-19 15:49:24 +03:00
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
This commit is contained in:
@@ -2193,7 +2193,7 @@ apply_handle_tuple_routing(ApplyExecutionData *edata,
|
||||
remoteslot_part = partrelinfo->ri_PartitionTupleSlot;
|
||||
if (remoteslot_part == NULL)
|
||||
remoteslot_part = table_slot_create(partrel, &estate->es_tupleTable);
|
||||
map = partrelinfo->ri_RootToPartitionMap;
|
||||
map = ExecGetRootToChildMap(partrelinfo, estate);
|
||||
if (map != NULL)
|
||||
{
|
||||
attrmap = map->attrMap;
|
||||
@@ -2353,7 +2353,7 @@ apply_handle_tuple_routing(ApplyExecutionData *edata,
|
||||
if (remoteslot_part == NULL)
|
||||
remoteslot_part = table_slot_create(partrel_new,
|
||||
&estate->es_tupleTable);
|
||||
map = partrelinfo_new->ri_RootToPartitionMap;
|
||||
map = ExecGetRootToChildMap(partrelinfo_new, estate);
|
||||
if (map != NULL)
|
||||
{
|
||||
remoteslot_part = execute_attr_map_slot(map->attrMap,
|
||||
|
Reference in New Issue
Block a user