On Sun, Jun 17, 2018 at 10:59 PM, David Rowley <david.row...@2ndquadrant.com> wrote: > Thanks for looking. > > Robert, do you have any objections to the proposed patch?
I don't have time to study this right now, but I think the main possible objection is around performance. If not flattening the Append is the best way to make queries run fast, then we should do it that way. If making pruning capable of coping with mixed hierarchies is going to be faster, then we should do that. If I were to speculate in the absence of data, my guess would be that failing to flatten the hierarchy is going to lead to a significant per-tuple cost, while the cost of making run-time pruning smarter is likely to be incurred once per rescan (i.e. a lot less). But that might be wrong, and it might be impractical to get this working perfectly in v11 given the time we have. But I would suggest that you performance test a query that ends up feeding lots of tuples through two Append nodes rather than one and see how much it hurts. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company