On Wed, Mar 6, 2019 at 9:12 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> I wrote:
> > I've already got a mostly-working patch. It's causing one plan change
> > in select_parallel that I've not quite figured out the reason for, or
> > I should say that it's not obvious why the existing code appears to
> > work...
>
> And here 'tis. I spent some time improving the existing comments, because
> it's not very clear what some of this is doing or why it has to be done
> that way.
This all looks good to me. I'm wondering about this chunk though:
+ bool rel_is_partitioned = (rel->part_scheme && rel->part_rels);
IIUC it' safe for now (according to f069c91a579), but should we use
IS_PARTITIONED_REL macro instead? If yes, probably
create_ordinary_grouping_paths() should be updated too.