Re: Functional dependency in GROUP BY through JOINs

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Functional dependency in GROUP BY through JOINs
Date: 2012-12-06 16:43:45
Message-ID: CA+U5nMLc7n3WwtdMs-btajEX+LNTZ5rOnj0=Tk4Ry_9r+5O9Ug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5 December 2012 23:37, David Rowley <dgrowleyml(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2012-12-06 16:52:46 Re: Serious problem: media recovery fails after system or PostgreSQL crash
Previous Message Andres Freund 2012-12-06 16:13:52 Re: [PATCH 03/14] Add simple xlogdump tool