Re: the right time to vacuum database?

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
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-08 15:34:57
Message-ID: 20070608153457.GM17144@phlogiston.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql

On Fri, Jun 08, 2007 at 08:20:36AM -0700, Charles.Hou wrote:
> because if the size of database have been increased 36MB in one day ,
> then it will be 1G MB increased after 1 month. so i worry about the
> size. other strange thing, if i block all postgresql client and run
> vacuumdb, there will have about 100MB free space.

Your conclusion of linear growth doesn't actually follow from your
premises. In any case, it sounds to me like (1) you're not vacuuming
often enough and (2) you have transactions open from the clients
which are preventing vacuuming from being effective. Autovacuum will
solve (1) now that you've enabled it, but you need to fix your
existing bloat (which probably means either VACUUM FULL or CLUSTER
and REINDEX). (2) is a bigger problem, which you need to address at
the client. Also, I bet your free space map is too small. Increase
it.

I have the feeling, on the basis of this thread, that you need to
spend some more time with the manual.

A

--
Andrew Sullivan | ajs(at)crankycanuck(dot)ca
In the future this spectacle of the middle classes shocking the avant-
garde will probably become the textbook definition of Postmodernism.
--Brad Holland

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message flickchick_one 2007-06-09 21:07:48 Re: preload libraries
Previous Message Charles.Hou 2007-06-08 15:20:36 Re: the right time to vacuum database?

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Kretschmer 2007-06-08 15:47:53 Re: show index from [table]
Previous Message Stefan Zweig 2007-06-08 15:25:40 show index from [table]