On Thu, Feb 8, 2018 at 8:05 AM, Jeevan Chalke <jeevan.cha...@enterprisedb.com> wrote: > In this attached version, I have rebased my changes over new design of > partially_grouped_rel. The preparatory changes of adding > partially_grouped_rel are in 0001.
I spent today hacking in 0001; results attached. The big change from your version is that this now uses generate_gather_paths() to add Gather/Gather Merge nodes (except in the case where we sort by group pathkeys and then Gather Merge) rather than keeping all of the bespoke code. That turned up to be a bit less elegant than I would have liked -- I had to an override_rows argument to generate_gather_paths to make it work. But overall I think this is still a big improvement, since it lets us share code instead of duplicating it. Also, it potentially lets us add partially-aggregated but non-parallel paths into partially_grouped_rel->pathlist and that should Just Work; they will get the Finalize Aggregate step but not the Gather. With your arrangement that wouldn't work. Please review/test. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
partially-grouped-rel-rmh.patch
Description: Binary data