Re: Index Backward Scan fast / Index Scan slow ! - Mailing list pgsql-performance

From Tom Lane
Subject Re: Index Backward Scan fast / Index Scan slow !
Date
Msg-id 8579.1081772899@sss.pgh.pa.us
Whole thread Raw
In response to Index Backward Scan fast / Index Scan slow !  (Pailloncy Jean-Gérard <pailloncy@ifrance.com>)
Responses Re: Index Backward Scan fast / Index Scan slow !
List pgsql-performance
=?ISO-8859-1?Q?Pailloncy_Jean-G=E9rard?= <pailloncy@ifrance.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

pgsql-performance by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Effect of too many columns
Next
From: "Shea,Dan [CIS]"
Date:
Subject: Deleting certain duplicates