pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pailloncy Jean-Gérard <pailloncy@ifrance.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Index Backward Scan fast / Index Scan slow !
Date: Mon, 12 Apr 2004 08:28:19 -0400
Message-ID: <8579.1081772899@sss.pgh.pa.us> (raw)
In-Reply-To: <8A2105D4-8C63-11D8-80FD-000A95DE2550@ifrance.com>
References: <8A2105D4-8C63-11D8-80FD-000A95DE2550@ifrance.com>

=?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



view thread (8+ messages)  latest in thread

Message-ID: <8579.1081772899@sss.pgh.pa.us>
Permalink:  ../8579.1081772899@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8579.1081772899@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, pailloncy@ifrance.com
  Subject: Re: Index Backward Scan fast / Index Scan slow !
  In-Reply-To: <8579.1081772899@sss.pgh.pa.us>

* 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