Re: Allow single table VACUUM in transaction block - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Allow single table VACUUM in transaction block
Date
Msg-id CANbhV-G4U08ne=9jY-Lp-4Ph1SQee9he3i7caC=OFUwvMeoROw@mail.gmail.com
Whole thread Raw
In response to Re: Allow single table VACUUM in transaction block  (Simon Riggs <simon.riggs@enterprisedb.com>)
Responses Re: Allow single table VACUUM in transaction block
List pgsql-hackers
On Fri, 18 Nov 2022 at 11:54, Simon Riggs <simon.riggs@enterprisedb.com> wrote:
>
> On Thu, 17 Nov 2022 at 20:00, Justin Pryzby <pryzby@telsasoft.com> wrote:
> >
> > On Wed, Nov 16, 2022 at 05:14:07PM -0500, Greg Stark wrote:
> > > I think this requesting autovacuum worker should be a distinct
> > > command. Or at least an explicit option to vacuum.
> >
> > +1.  I was going to suggest VACUUM (NOWAIT) ..
>
> Yes, I have no problem with an explicit command.
>
> At the moment the patch runs VACUUM in the background in an autovacuum
> process, but the call is asynchronous, since we do not wait for the
> command to finish (or even start).
>
> So the command names I was thinking of would be one of these:
>
> VACUUM (BACKGROUND) or VACUUM (AUTOVACUUM) - which might be clearer
> or
> VACUUM (ASYNC) - which is more descriptive of the behavior
>
> or we could go for both
> VACUUM (BACKGROUND, ASYNC) - since this allows us to have a
> BACKGROUND, SYNC version in the future


Attached patch implements VACUUM (BACKGROUND).

There are quite a few small details to consider; please read the docs
and comments.

There is a noticeable delay before the background vacuum starts.

-- 
Simon Riggs                http://www.EnterpriseDB.com/

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Damage control for planner's get_actual_variable_endpoint() runaway
Next
From: Simon Riggs
Date:
Subject: Re: Damage control for planner's get_actual_variable_endpoint() runaway