Re: Possible to trigger autovacuum?

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
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-20 08:59:08
Message-ID: 202402200859.5gt53t4xlahf@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2024-Feb-19, 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.

Autovacuum has a mechanism to be requested work -- grep the tree for
AutoVacuumRequestWork and AutoVacuumWorkItemType. Currently its only
use is BRIN autosummarization, but it's possible to add others by
patching the core code. If you want to propose the idea of making it
extensible, I think it would serve not only your present use case but
plenty of others, too.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2024-02-20 09:35:44 Re: Synchronizing slots from primary to standby
Previous Message Amit Kapila 2024-02-20 08:43:41 Re: About a recently-added message