pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bill Montgomery <billm@lulu.com>
To: Paul Langard <pjl@intercellsolutions.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow select, insert, update
Date: Tue, 10 Aug 2004 14:56:28 -0400
Message-ID: <41191A5C.7020409@lulu.com> (raw)
In-Reply-To: <B668647A-EA24-11D8-9D1D-000A95B97268@intercellsolutions.com>
References: <B668647A-EA24-11D8-9D1D-000A95B97268@intercellsolutions.com>

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



view thread (5+ messages)  latest in thread

Message-ID: <41191A5C.7020409@lulu.com>
Permalink:  ../41191A5C.7020409@lulu.com/
Also on:    postgresql.org/message-id/41191A5C.7020409@lulu.com

 · 

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: billm@lulu.com, pjl@intercellsolutions.com
  Subject: Re: Slow select, insert, update
  In-Reply-To: <41191A5C.7020409@lulu.com>

* 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