Make RelationGetPartitionDispatchInfo expand depth-first.

Robert Haas <rhaas@postgresql.org>

Commit: 77b6b5e9ceca04dbd6f0f6cd3fc881519acc8714
Author: Robert Haas <rhaas@postgresql.org>
Date: 2017-09-14T16:28:50Z
Releases: 11.0
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

Files

PathChange+/−
src/backend/catalog/partition.c modified +109 −143
src/backend/optimizer/prep/prepunion.c modified +7 −0

Discussion