Re: Slow select, insert, update

From: Bill Montgomery <billm(at)lulu(dot)com>
To: Paul Langard <pjl(at)intercellsolutions(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow select, insert, update
Date: 2004-08-10 18:56:28
Message-ID: 41191A5C.7020409@lulu.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Paul,

Paul Langard wrote:

> Having trouble with one table (see time to count records below!).
>
> Fairly new to postgres so any help much appreciated.
>
> It only contains 9,106 records - as you can see from:
>
>
> select count(id) from project
>
> *count
> *9106
> 1 row(s)
> Total runtime: 45,778.813 ms

<snip>

> ... the database is regularly vaccuumed.

Have you tried doing a VACUUM FULL, CLUSTER, or drop/restore on the
table? This sounds symptomatic of a table with a bunch of dead tuples
not in the FSM (free space map). Only tuples in the FSM are reclaimed by
a regular VACUUM. If your FSM parameters in postgresql.conf are not big
enough for your ratio of UPDATE/DELETE operations to VACUUM frequency,
you will end up with dead tuples that will only be reclaimed by a VACUUM
FULL.

To prevent this problem in the future, look at increasing your FSM size
and possibly vacuuming more frequently or using pg_autovacuum.

Good Luck,

Bill Montgomery

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jason Coene 2004-08-10 19:17:32 Hardware upgrade for a high-traffic database
Previous Message Bill Montgomery 2004-08-10 18:49:29 Re: Column order performance