Re: POC: Parallel processing of indexes in autovacuum

Daniil Davydov <3danissimo@gmail.com>

From: Daniil Davydov <3danissimo@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Sami Imseih <samimseih@gmail.com>, Alexander Korotkov <aekorotkov@gmail.com>, Matheus Alcantara <matheusssilv97@gmail.com>, Maxim Orlov <orlovmg@gmail.com>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-01-07T09:51:06Z
Lists: pgsql-hackers

Attachments

Hi,

On Tue, Jan 6, 2026 at 3:44 AM Daniil Davydov <3danissimo@gmail.com> wrote:
>
> On Tue, Jan 6, 2026 at 1:51 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
> >
> > Are you still working on it? Or shall I draft this part on top of the
> > 0001 patch?
>
> I thought about some "beautiful" approach, but for now I have
> only one idea - force parallel a/v workers to get values for these
> parameters from shmem (which obviously can be modified by the
> leader a/v process). I'll post this patch in the near future.
>

I am posting a draft version of the patch (see 0005) that allows parallel
leader to propagate changes of cost-based parameters to its parallel
workers. It is a very rough fix, but it reflects my idea that is to have some
shared state from which parallel workers can get values for the parameters
(and which only leader worker can modify, obviously).

I have also added a test that shows that this idea is working - the test
ensures that parallel workers can change its parameters if they have been
changed for the leader worker.

Note that so far the work is in progress - this logic works only for
vacuum_cost_delay and vacuum_cost_limits parameters. I think that we
should agree on an idea first, and only then apply logic for all appropriate
parameters.

What do you think?

--
Best regards,
Daniil Davydov

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Allow autovacuum to use parallel vacuum workers.

  2. Add parallel vacuum worker usage to VACUUM (VERBOSE) and autovacuum logs.

  3. doc: Put new options in consistent order on man pages