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: Alexander Korotkov <aekorotkov@gmail.com>, SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>,
Sami Imseih <samimseih@gmail.com>, Matheus Alcantara <matheusssilv97@gmail.com>,
Maxim Orlov <orlovmg@gmail.com>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-04-03T11:43:33Z
Lists: pgsql-hackers
Hi, On Fri, Apr 3, 2026 at 6:31 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote: > > What do you think about the idea of using proc signals like the patch > I've sent recently[1]? With that approach, workers have to check the > local variable. It seems slightly cheaper and can use the existing > logic. > Thank you for the patch! 1) Maybe we should implement this logic within ParallelMessages? For example, I see this ParallelMessages use case in parallel a/v : /* * Call the parallel variant of pgstat_progress_incr_param so workers can * report progress of index vacuum to the leader. */ pgstat_progress_parallel_incr_param(PROGRESS_VACUUM_INDEXES_PROCESSED, 1); I.e. parallel a/v workers already communicate with a leader via ParallelMessages, so it will be convenient to extend this protocol by a new message. 2) I don't think that the difference between accessing atomic and local variable can be measured for parallel workers. But sending a signal to every parallel worker is surely slower than just incrementing an atomic variable. IIUC you created this patch in order to solve the task of using an existing infrastructure instead of creating a new utilitarian solution. However, I think that both the polling approach and signalling approach (in its current implementation) are basically equal. I mean that in both cases we have an autovacuum-specific mechanism to share particular parameters between particular workers. I will try to explain how I see the solution to this problem. : Your implementation can be made more abstract, so that it becomes a new internal mechanism that other modules can use in the future. E.g. we can create an interface that allows any parallel leader (not necessarily just an autovacuum leader) to inform its parallel workers that some config parameters have been changed. At the same time, parallel workers can use this interface in order to specify, which parameters (or groups of parameters) they want to consume from the leader. 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 →
-
Allow autovacuum to use parallel vacuum workers.
- 1ff3180ca016 19 (unreleased) landed
-
Add parallel vacuum worker usage to VACUUM (VERBOSE) and autovacuum logs.
- adcdbe93860b 19 (unreleased) landed
-
doc: Put new options in consistent order on man pages
- bc35adee8d7a 18.0 cited