On Tue, Mar 8, 2016 at 4:26 PM, David Rowley <david.row...@2ndquadrant.com> wrote: >> The first one in the list will be the cheapest; why not just look at >> that? Sorted partial paths are interesting if some subsequent path >> construction step can make use of that sort ordering, but they're >> never interesting from the point of view of matching the query's >> pathkeys because of the fact that Gather is order-destroying. > > In this case a sorted partial path is useful as the partial agg node > sits below Gather. The sorted input is very interesting for the > partial agg node with a strategy of AGG_SORTED. In most cases with > parallel aggregate it's the partial stage that will take the most > time, so if we do get pre-sorted partial paths, this will be very good > indeed for parallel agg.
OK. So then you probably want to consider the cheapest one, which will be first. And then, if there's one that has the pathkeys you want, also consider that. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (email@example.com) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers