Re: Slow select, insert, update - Mailing list pgsql-performance

From Bill Montgomery
Subject Re: Slow select, insert, update
Date
Msg-id 41191A5C.7020409@lulu.com
Whole thread Raw
In response to Slow select, insert, update  (Paul Langard <pjl@intercellsolutions.com>)
List 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

pgsql-performance by date:

Previous
From: "Jason Coene"
Date:
Subject: Hardware upgrade for a high-traffic database
Next
From: Bill Montgomery
Date:
Subject: Re: Column order performance