Re: AutoVacuum on demand?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Glen Parker <glenebob(at)nwlink(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: AutoVacuum on demand?
Date: 2006-11-13 22:40:02
Message-ID: 20061113224002.GA22291@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Glen Parker wrote:
> Matthew T. O'Connor wrote:
> >Glen Parker wrote:
> >>I would like a way to run the autovacuum daemon on demand
> >>periodically. Every night at 2 AM, for example.
> >>
> >>Anybody know if this is possible? If not, it's a feature request :-)
> >
> >Autovacuum can be enabled / disabled on the fly using the GUC settings.
> >Perhaps you can write a cron script that runs at 2AM that enables
> >autovac, and at 6AM (just a guess) disables it in the same fashion. I
> >think that should work.
> >
> >Would be curious to hear your results.
>
> I thought it sounded like a good idea, but then...
>
> SET autovacuum = on;
> ERROR: parameter "autovacuum" cannot be changed now

I think the idea is to edit the postgresql.conf file on the fly and send
a SIGHUP to the postmaster. I haven't ever heard of anyone doing that,
but I don't see any reason why it wouldn't work.

I'm not sure if the version you are running supports "include"
directives in postgresql.conf (heck, I'm not even sure if it's possible
to do in 8.2); if that's the case, then it's considerably easier.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Casey Duncan 2006-11-13 22:49:13 Re: AutoVacuum on demand?
Previous Message Martijn van Oosterhout 2006-11-13 22:32:22 Re: Table and Field namestyle best practices?