Re: autovacuum, exclude table

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Anibal David Acosta <aa(at)devshock(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: autovacuum, exclude table
Date: 2011-12-12 15:16:08
Message-ID: 4EE61AB8.1010202@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 12.12.2011 16:25, Anibal David Acosta wrote:
> I have a couple of tables with about 400millions of records increasing about
> 5 millions per day.
>
> I think that disabling autovac over those tables, and enabling daily manual
> vacuum (in some idle hour) will be better.
>
> I am right?

Possibly. If the system is otherwise idle, it sounds sensible to do
routine maintenance at that time.

> Is possible to exclude autovacuum over some tables?

Sure, see
http://www.postgresql.org/docs/9.1/static/sql-createtable.html#SQL-CREATETABLE-STORAGE-PARAMETERS

ALTER TABLE foo SET (autovacuum_enabled=false, toast.autovacuum_enabled
= false);

It might be better, though, to let autovacuum enabled, and just do the
additional manual VACUUM in the idle period. If the daily manual VACUUM
is enough to keep the bloat within the autovacuum thresholds, autovacuum
will never kick in. If it's not enough, then you probably want
autovacuum to run.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2011-12-12 15:26:10 Re: autovacuum, exclude table
Previous Message Anibal David Acosta 2011-12-12 14:55:00 Re: autovacuum, exclude table