On 25 July 2018 at 01:46, Tom Lane <t...@sss.pgh.pa.us> wrote: > Hm, wouldn't this be fixed by your pending patch at > <cakjs1f_eywhk2x0xx7qw42rv_grsjgbme3aqn9mylrss1s+...@mail.gmail.com> > ?
It's a different issue. I coded run-time pruning with the incorrect assumption that we only get leaf partitions under an Append which have a non-empty partitioned_rels List. The other patch fixes it to supported mixed hierarchies from UNION ALLs. It'll still trip up on anything apart from leaf partitions being in the subpaths list. Thinking again about the patch I submitted upthread; I wonder if it's actually possible to support pruning with Jamie's query. Without looking at the code, I don't quite see the reason that the sub-partitioned table wouldn't be correctly pruned by the run-time pruning code. It could just be a matter of removing the failing Assert(). I'll do a bit more testing and confirm. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services