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-03-16T20:54:43Z
Lists: pgsql-hackers

Attachments

Hi,

On Mon, Mar 16, 2026 at 11:46 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
> While both ideas can achieve our goal of this feature in general, the
> new idea doesn't require an additional layer of reserve/release logic
> on top of the existing bgworker pool, which is good. I've not tried
> coding this idea but I believe the patch can be simplified very much.
> So I agree to move to this idea.
>

OK, let's do it!

Please, see an updated set of patches. Main changes are :
0001 patch - removed all logic related to the parallel workers reserving.
0002 patch - no changes regarding v26.
0003 patch - no changes regarding v26.
0004 patch - removed all stuff related to the "test_autovacuum" extension.
             Also removed 3th, 4th and 5th tests, because they were related
             only to the workers reserving logic.
0005 patch - minor changes reflecting the new GUC parameter's purpose.

I have maintained the independence of the tests from the user-facing logging.
Instead of "nworkers released" logs I have added a single log at the end of
one round of parallel processing :
"av worker: finished parallel index processing with N parallel workers".
This is the only code that I added rather than deleted within the 0001 patch.

I hope I didn't miss anything.

--
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