public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Chris Cleveland <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Possible to trigger autovacuum?
Date: Tue, 20 Feb 2024 08:02:34 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <CABSN6VfgfrECprJQSs0=qhaJd1usXQtQMOz_AGd-UVaGXJFQNw@mail.gmail.com>
References: <CABSN6VfgfrECprJQSs0=qhaJd1usXQtQMOz_AGd-UVaGXJFQNw@mail.gmail.com>

On Mon, Feb 19, 2024 at 03:15:29PM -0600, Chris Cleveland wrote:
> Is it possible to launch an autovacuum from within an extension?
> 
> I'm developing an index access method. After the index gets built it needs
> some cleanup and optimization. I'd prefer to do this in the
> amvacuumcleanup() method so it can happen periodically and asynchronously.
> 
> I could fire up a background worker to do the job, but it would be a lot
> simpler to call please_launch_autovacuum_right_now();

The autovacuum launcher can be stopped in its nap with signals, like a
SIGHUP.  So you could rely on that to force a job to happen on a given
database based on the timing you're aiming for.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../[email protected]/2-signature.asc)
  download

view thread (5+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Possible to trigger autovacuum?
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox