Re: expanding inheritance in partition bound order
Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
From: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Amit Khandekar <amitdkhan.pg@gmail.com>,
Robert Haas <robertmhaas@gmail.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2017-08-18T05:02:50Z
Lists: pgsql-hackers
On Fri, Aug 18, 2017 at 10:12 AM, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote > >>> 0002: Teach expand_inherited_rtentry to use partition bound order >> >> 0004 in [1] expands a multi-level partition hierarchy into similar >> inheritance hierarchy. That patch doesn't need all OIDs in one go. It >> will have to handle the partition hierarchy level by level, so most of >> the code added by this patch will need to be changed by that patch. Is >> there a way we can somehow change this patch so that the delta in 0004 >> is reduced? That may need rethinking about using >> RelationGetPartitionDispatchInfo(). > > Regarding that, I have a question: > > Does the multi-level partition-wise join planning logic depend on the > inheritance itself to be expanded in a multi-level aware manner. That is, > expanding the partitioned table inheritance in multi-level aware manner in > expan_inherited_rtentry()? Yes, it needs AppendRelInfos to retain the parent-child relationship. Please refer [1], [2], [3] for details. > > Wouldn't it suffice to just have the resulting Append paths be nested per > multi-level partitioning hierarchy? We are joining RelOptInfos, so those need to be nested. For those to be nested, we need AppendRelInfos to preserve parent-child relationship. Nesting paths doesn't help. Append paths actually should be flattened out to avoid any extra time consumed in nested Append node. [1] https://www.postgresql.org/message-id/CAFjFpRceMmx26653XFAYvc5KVQcrzcKScVFqZdbXV%3DkB8Akkqg@mail.gmail.com [2] https://www.postgresql.org/message-id/CAFjFpRefs5ZMnxQ2vP9v5zOtWtNPuiMYc01sb1SWjCOB1CT=uQ@mail.gmail.com [3] https://www.postgresql.org/message-id/CAFjFpRd6Kzx6Xn%3D7vdwwnh6rEw2VEgo--iPdhV%2BFb7bHfPzsbw%40mail.gmail.com -- Best Wishes, Ashutosh Bapat EnterpriseDB Corporation The Postgres Database Company
Commits
-
Make RelationGetPartitionDispatchInfo expand depth-first.
- 77b6b5e9ceca 11.0 landed
-
Expand partitioned tables in PartDesc order.
- 30833ba154e0 11.0 landed
-
Don't lock tables in RelationGetPartitionDispatchInfo.
- 7c0ca2900f7c 10.0 landed
- 54cde0c4c058 11.0 landed
-
Speed up dropping tables with many partitions.
- c1e0e7e1d790 10.0 cited