Re: Index Backward Scan fast / Index Scan slow !

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pailloncy Jean-Gérard <pailloncy(at)ifrance(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Index Backward Scan fast / Index Scan slow !
Date: 2004-04-12 12:28:19
Message-ID: 8579.1081772899@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

=?ISO-8859-1?Q?Pailloncy_Jean-G=E9rard?= <pailloncy(at)ifrance(dot)com> writes:
> How to optimize the last query ? (~ 2000 times slower than the first
> one)
> I suppose there is some odd distribution of data in the index ?

Looks to me like a whole lot of dead rows at the left end of the index.
Have you VACUUMed this table lately? It would be interesting to see
what VACUUM VERBOSE has to say about it.

> Is the solution to reindex data ?

In 7.4 a VACUUM should be sufficient ... or at least, if it isn't
I'd like to know why not before you destroy the evidence by reindexing.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Shea,Dan [CIS] 2004-04-12 14:39:22 Deleting certain duplicates
Previous Message Bruno Wolff III 2004-04-12 12:17:40 Re: Effect of too many columns