Re: SELECT DISTINCT too slow

From: Florian Weimer <fw(at)deneb(dot)enyo(dot)de>
To: Miroslav ?ulc <miroslav(dot)sulc(at)startnet(dot)cz>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: SELECT DISTINCT too slow
Date: 2006-06-01 18:59:05
Message-ID: 87d5dsn1mu.fsf@mid.deneb.enyo.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

* Alvaro Herrera:

> Miroslav ?ulc wrote:
>> The GROUP BY is really fast :-)
>
> Doh! How does it do it?

It uses a hash table and can therefore discard duplicate rows more
quickly (essentially linear time in the number of rows if the number
of different rows is bounded).

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2006-06-01 19:21:31 Re: Am I crazy or is this SQL not possible
Previous Message Yasir Malik 2006-06-01 18:53:41 Re: Am I crazy or is this SQL not possible