On Thu, 28 Mar 2019 at 14:34, Amit Langote <langote_amit...@lab.ntt.co.jp> wrote: > > On 2019/03/28 7:29, David Rowley wrote: > > On Wed, 27 Mar 2019 at 19:48, Amit Langote > > It does need to know how many partitions the partitioned table has, > > which it gets from partrel->nparts, so yeah, RelOptInfo is probably > > needed. I don't think passing in int nparts is a good solution to > > that. The problem with moving it to partbounds.c is that nothing > > there knows about RelOptInfo currently. > > Maybe, this could be a start. Also, there is a patch in nearby thread > which adds additional functionality to partbounds.c to be used by > partitionwise join code in the optimizer [1].
Thanks for the review. I've attached a patch that mostly just moved the code around. I also changed the comment in build_partition_pathkeys() to explain about the nulls_first argument and why I just pass ScanDirectionIsBackward(scandir). Also, another comment in struct PlannerInfo to mentioning the guarantee about append_rel_list having earlier partitions as defined in PartitionDesc earlier in the list. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
mergeappend_to_append_conversion_v16.patch
Description: Binary data