Re: the right time to vacuum database?

From: Chander Ganesan <chander(at)otg-nc(dot)com>
To: "Charles(dot)Hou" <ivan(dot)hou(at)msa(dot)hinet(dot)net>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: the right time to vacuum database?
Date: 2007-06-05 13:12:21
Message-ID: 46656135.5050806@otg-nc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql

Charles.Hou wrote:
> how can i know that it's the time to vacuumdb? i set the crontab to
> vacuumdb 3 times in one day. because my database size increase from
> 440MB to 460MB in 8 hours.
>
>
> ---------------------------(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
>
What Version of PostgreSQL are you using? If it's recent ( > 8.1) you
might benefit from using AutoVacuum (AVD), which will take care of
vacuuming for you once table fragmentation (the ratio of dead tuples to
total tuples) becomes an issue. Otherwise, it's hard to tell based on
your metric above. You may have one small table that is updated a lot
(in which case a vacuum is a good idea on that table) or lots of tables
that are updated a little (in which its probably overkill). Your best
bet might be to turn on row level stats collection and look at the
statistics to see if one or more tables is becoming fragmented (BTW,
this is what AVD does). 440 to 460 doesn't seem to significant to me,
but it all depends on the size of your tables, update/delete profile, etc.

--
Chander Ganesan
The Open Technology Group
One Copley Parkway, Suite 210
Morrisville, NC 27560
Phone: 877-258-8987/919-463-0999
http://www.otg-nc.com

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Brad Nicholson 2007-06-05 13:12:47 Re: the right time to vacuum database?
Previous Message Alvaro Herrera 2007-06-05 12:47:12 Re: Auto Vacuum question?

Browse pgsql-sql by date

  From Date Subject
Next Message Brad Nicholson 2007-06-05 13:12:47 Re: the right time to vacuum database?
Previous Message Ranieri Mazili 2007-06-05 13:11:59 CREATE RULE with WHERE clause