Re: way to speed up a SELECT DISTINCT?

From: Shridhar Daithankar <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: Seth Ladd <seth(at)picklematrix(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: way to speed up a SELECT DISTINCT?
Date: 2003-10-10 11:00:30
Message-ID: 3F86914E.2070100@persistent.co.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Seth Ladd wrote:

>> peter(at)bernardo:express=# explain select distinct region from region;
>> QUERY PLAN
>> -----------------------------------------------------------------------
>> -----------------------
>> Unique (cost=0.00..4326.95 rows=9518 width=14)
>> -> Index Scan using regionview_region on region (cost=0.00..4089.00
>> rows=95183 width=14)
>> (2 rows)
>
>
> Thanks for the tip, I'll give this a shot soon. I am curious, your
> example above does not use GROUP BY yet you have an INDEX SCAN. I am
> using a similar query, yet I get a full table scan. I wonder how they
> are different?

Have you tuned your shared buffers and effective cache correctly?

Shridhar

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Christopher Kings-Lynne 2003-10-10 11:05:27 Re: way to speed up a SELECT DISTINCT?
Previous Message Seth Ladd 2003-10-10 10:50:48 Re: way to speed up a SELECT DISTINCT?