Re: possible bug with group by? - Mailing list pgsql-sql

From Tom Lane
Subject Re: possible bug with group by?
Date
Msg-id 19251.959223598@sss.pgh.pa.us
Whole thread Raw
In response to Re: possible bug with group by?  (Joseph Shraibman <jks@selectacast.net>)
List pgsql-sql
Joseph Shraibman <jks@selectacast.net> writes:
> But why would group by need to sort it?  To insert it into a tree to
> make lookups of distinct values faster?

No, to bring identical values together.  GROUP BY and DISTINCT are both
implemented as basically a "sort | uniq" pipeline.
        regards, tom lane


pgsql-sql by date:

Previous
From: Joseph Shraibman
Date:
Subject: Re: possible bug with group by?
Next
From: Tom Lane
Date:
Subject: Re: Use of index in 7.0 vs 6.5