mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Make RelationGetPartitionDispatchInfo expand depth-first.
With this change, the order of leaf partitions as returned by RelationGetPartitionDispatchInfo should now be the same as the order used by expand_inherited_rtentry. This will make it simpler for future patches to match up the partition dispatch information with the planner data structures. The new code is also, in my opinion anyway, simpler and easier to understand. Amit Langote, reviewed by Amit Khandekar. I also reviewed and made a few cosmetic revisions. Discussion: http://postgr.es/m/d98d4761-5071-1762-501e-0e15047c714b@lab.ntt.co.jp
This commit is contained in:
@ -1565,6 +1565,13 @@ expand_inherited_rtentry(PlannerInfo *root, RangeTblEntry *rte, Index rti)
|
||||
root->append_rel_list = list_concat(root->append_rel_list, appinfos);
|
||||
}
|
||||
|
||||
/*
|
||||
* expand_partitioned_rtentry
|
||||
* Recursively expand an RTE for a partitioned table.
|
||||
*
|
||||
* Note that RelationGetPartitionDispatchInfo will expand partitions in the
|
||||
* same order as this code.
|
||||
*/
|
||||
static void
|
||||
expand_partitioned_rtentry(PlannerInfo *root, RangeTblEntry *parentrte,
|
||||
Index parentRTindex, Relation parentrel,
|
||||
|
Reference in New Issue
Block a user