Re: Possible to trigger autovacuum?

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Chris Cleveland <ccleveland(at)dieselpoint(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Possible to trigger autovacuum?
Date: 2024-02-19 23:02:34
Message-ID: ZdPeChmhrTUM7KBR@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2024-02-19 23:05:23 Re: Streaming read-ready sequential scan code
Previous Message David E. Wheeler 2024-02-19 22:59:38 Re: Patch: Add parse_type Function