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

Re: When to vacuum a table?

From: "Marcelo Costa" <marcelojscosta(at)gmail(dot)com>
To: "Joost Kraaijeveld" <J(dot)Kraaijeveld(at)askesis(dot)nl>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: When to vacuum a table?
Date: 2006-11-26 12:43:11
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance


"VACUUM reclaims storage occupied by deleted tuples. In normal
PostgreSQLoperation, tuples that are deleted or obsoleted by an update
are not
physically removed from their table; they remain present until a VACUUM is
done. Therefore it's necessary to do VACUUM periodically, especially on
frequently-updated tables."

"The "vacuum analyze" form additionally collects statistics on the
disbursion of columns in the database, which the optimizer uses when it
calculates just how to execute queries. The availability of this data can
make a tremendous difference in the execution speed of queries. This command
can also be run from cron, but it probably makes more sense to run this
command as part of your nightly backup procedure - if "vacuum" is going to
screw up the database, you'd prefer it to happen immediately after (not
before!) you've made a backup! The "vacuum" command is very reliable, but
conservatism is the key to good system management. So, if you're using the
export procedure described above, you don't need to do this extra step".

All its tables constantly manipulated (INSERT, UPDATE, DELETE) they need a
VACUUM, therefore the necessity to execute at least one time to the day
normally of dawn if its database will be very great .


Marcelo Costa
Secretaria Executiva de Educação do Pará
Amazonia - Pará - Brazil

2006/11/26, Joost Kraaijeveld <J(dot)Kraaijeveld(at)askesis(dot)nl>:
> Hi,
> 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?
> --
> Groeten,
> Joost Kraaijeveld
> Askesis B.V.
> Molukkenstraat 14
> 6524NB Nijmegen
> tel: 024-3888063 / 06-51855277
> fax: 024-3608416
> web:
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>        message can get through to the mailing list cleanly

Marcelo Costa

In response to


pgsql-performance by date

Next:From: Steinar H. GundersonDate: 2006-11-26 13:11:47
Subject: Re: When to vacuum a table?
Previous:From: Joost KraaijeveldDate: 2006-11-26 11:24:17
Subject: When to vacuum a table?

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