Re: Large table performance and vacuum

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: gavin(at)ipalsoftware(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Large table performance and vacuum
Date: 2004-03-05 22:07:55
Message-ID: 11756.1078524475@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Gavin Scott <gavin(at)ipalsoftware(dot)com> writes:
> The problem is the query "SELECT * FROM log ORDER BY hid
> LIMIT 1;", which both EXPLAIN and EXPLAIN ANALYZE show as
> Limit / Index Scan on hid_idx. This was very fast before we
> started deleting out old log entries the table, but has
> started taking an extremely long time, about 341 seconds.

I'm suspecting that you need to REINDEX hid_idx. This is an
aspect of the pre-7.4 "index bloat" problem: the left end of the index
now consists of entirely-empty pages, which not only occupy space but
take time to scan through for a query like this.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Mascari 2004-03-05 22:48:00 Re: Large table performance and vacuum
Previous Message Joshua D. Drake 2004-03-05 21:46:59 Re: Setting up Postgresql on Linux