Re: Functional dependency in GROUP BY through JOINs
Simon Riggs <simon@2ndquadrant.com>
From: Simon Riggs <simon@2ndQuadrant.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: pgsql-hackers@postgresql.org
Date: 2012-12-06T16:43:45Z
Lists: pgsql-hackers
On 5 December 2012 23:37, David Rowley <dgrowleyml@gmail.com> wrote: > Though this plan might not be quite as optimal as it could be as it performs > the grouping after the join. PostgreSQL always calculates aggregation as the last step. It's a well known optimisation to push-down GROUP BY clauses to the lowest level, but we don't do that, yet. You're right that it can make a massive difference to many queries. -- Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services