pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
To: Seth Ladd <seth@picklematrix.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: way to speed up a SELECT DISTINCT?
Date: Fri, 10 Oct 2003 16:30:30 +0530
Message-ID: <3F86914E.2070100@persistent.co.in> (raw)
In-Reply-To: <9BE142FC-FB0F-11D7-A8D2-000A9576D038@picklematrix.net>
References: <9BE142FC-FB0F-11D7-A8D2-000A9576D038@picklematrix.net>

Seth Ladd wrote:

>> peter@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




view thread (6+ messages)  latest in thread

Message-ID: <3F86914E.2070100@persistent.co.in>
Permalink:  ../3F86914E.2070100@persistent.co.in/
Also on:    postgresql.org/message-id/3F86914E.2070100@persistent.co.in

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: shridhar_daithankar@persistent.co.in, seth@picklematrix.net
  Subject: Re: way to speed up a SELECT DISTINCT?
  In-Reply-To: <3F86914E.2070100@persistent.co.in>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox