Re: DISTINCT -> GROUP BY - Mailing list pgsql-hackers

From Decibel!
Subject Re: DISTINCT -> GROUP BY
Date
Msg-id 8404931B-038E-4F98-98C9-BCEC81B476DF@decibel.org
Whole thread Raw
In response to Re: DISTINCT -> GROUP BY  (David Fetter <david@fetter.org>)
List pgsql-hackers
On Jun 3, 2008, at 9:03 AM, David Fetter wrote:
> On Tue, Jun 03, 2008 at 03:36:44PM +0200, Pavel Stehule wrote:
>> Hello David
>>
>> http://www.postgresql.org/docs/faqs.TODO.html
>>
>> Consider using hash buckets to do DISTINCT, rather than sorting This
>> would be beneficial when there are few distinct values. This is
>> already used by GROUP BY.
>
> It's nice to see that this is kinda on the TODO, but it doesn't
> address the question I asked, which is, "how would I get the planner
> to rewrite DISTINCTs as the equivalent GROUP BYs?" :)

IIRC, the patch to allow GROUP BY to do hashing is fairly recent...  
you could probably find it in archives.
-- 
Decibel!, aka Jim C. Nasby, Database Architect  decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828



pgsql-hackers by date:

Previous
From: Decibel!
Date:
Subject: Re: intercepting WAL writes
Next
From: Decibel!
Date:
Subject: Re: Proposal: new function array_init