Skip site navigation (1) Skip section navigation (2)

Re: When to vacuum a table?

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Joost Kraaijeveld" <J(dot)Kraaijeveld(at)Askesis(dot)nl>,<pgsql-performance(at)postgresql(dot)org>
Subject: Re: When to vacuum a table?
Date: 2006-11-27 18:59:48
Message-ID: 456AE144.EE98.0025.0@wicourts.gov (view raw or flat)
Thread:
Lists: pgsql-performance
>>> On Sun, Nov 26, 2006 at  5:24 AM, in message
<1164540257(dot)7902(dot)0(dot)camel(at)panoramix>, Joost Kraaijeveld
<J(dot)Kraaijeveld(at)Askesis(dot)nl> wrote: 
> 
> Are there guidelines (or any empirical data) available how to
determine
> how often a table should be vacuumed for optimum performance or is
this
> an experience / trial- and- error thing?
 
For most of our databases we use a daily "VACUUM ANALYZE VERBOSE;".  We
grep the results to show large numbers of removable  or dead rows and to
show the fsm numbers at the end.  There are a few small tables with high
update rates which this doesn't cover.  To handle that we set the
autovacuum to 0.2/0.1 and 1/1 on a ten second interval and do a daily
CLUSTER of these tables.  We really don't have many tables which can hit
these autovacuum thresholds in one day.
 
We have databases which are 400 GB with the vast majority of that being
in tables which are insert-only except for a weekly purge of data over a
year old.  We do nightly vacuums on the few tables with update/delete
activity, and a weekly vacuum of the whole database -- right after the
delete of old rows from the big tables.
 
-Kevin
 


In response to

pgsql-performance by date

Next:From: Tom LaneDate: 2006-11-28 02:59:06
Subject: Re: BUG #2784: Performance serious degrades over a period of a month
Previous:From: Florian WeimerDate: 2006-11-27 18:11:57
Subject: Re: Postgres server crash

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group