Re: Performance question (stripped down the problem) - Mailing list pgsql-general

From Tom Lane
Subject Re: Performance question (stripped down the problem)
Date
Msg-id 28138.1000907704@sss.pgh.pa.us
Whole thread Raw
In response to Re: Performance question (stripped down the problem)  ("Matt Block" <matt@blockdev.net>)
Responses Re: Performance question (stripped down the problem)
List pgsql-general
"Matt Block" <matt@blockdev.net> writes:
> I've not yet looked at the rest of the problem, but doesn't
> ORDER BY make GROUP BY redundant?  Just an extra sort?

No.  In the first place, there's no extra sort: the planner is well
aware that our current GROUP BY implementation produces ordered output.
In the second place, there's no guarantee that GROUP BY will always
produce ordered output in the future --- we are thinking about changing
over to a hash-table-based implementation of grouping.  If you want
ordered output, you should say ORDER BY, not try to outsmart the system.

            regards, tom lane

pgsql-general by date:

Previous
From: "Brent R. Matzelle"
Date:
Subject: Re: read in to psql from file
Next
From: Thomas Lockhart
Date:
Subject: Re: Performance problems with arithmetic operators