Re: select distinct and index usage

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: David Wilson <david(dot)t(dot)wilson(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: select distinct and index usage
Date: 2008-04-07 02:20:15
Message-ID: 47F984DF.9060801@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Wilson wrote:
> On another table in the same database with a much smaller number of
> total rows (~15m rows), I have the exact same situation- but in this
> case the index on the datestamp column *is* used:
>
Have you run ANALYZE on both tables?

It might be worth increasing the stats collected on the datestamp column
(or all columns in the table), re-running ANALYZE on the table, and
seeing what happens.

Also, is there any chance that that's a lot more variation in datestamp
values in your problem table than the one where the index is used?

--
Craig Ringer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Wilson 2008-04-07 02:41:56 Re: select distinct and index usage
Previous Message Guillaume Bog 2008-04-07 01:23:31 Re: pl/pgsql RECORD data type, how to access to the values