way to speed up a SELECT DISTINCT?

From: Seth Ladd <seth(at)picklematrix(dot)net>
To: pgsql-performance(at)postgresql(dot)org
Subject: way to speed up a SELECT DISTINCT?
Date: 2003-10-10 09:41:36
Message-ID: F0B89090-FB05-11D7-A8D2-000A9576D038@picklematrix.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hello,

I am running 7.3.2 RPMs on RH9, on a celeron 1.7 w/ 1gig ram.

I have a table that has 6.9 million rows, 2 columns, and an index on
each column. When I run:

SELECT DISTINCT column1 FROM table

It is very, very slow (10-15 min to complete). An EXPLAIN shows no
indexes are being used.

Is there any way to speed this up, or is that DISTINCT going to keep
hounding me?

I checked the mailing list, and didn't see anything like this.

Any tips or hints would be greatly appreciated. Thanks for your help!
Seth

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Peter Childs 2003-10-10 10:07:23 Re: way to speed up a SELECT DISTINCT?
Previous Message Peter Childs 2003-10-10 08:51:43 Re: Speeding up Aggregates