23% Faster Autovacuum with Parallel Workers in PostgreSQL 19
Before PostgreSQL 19, autovacuum processed indexes without using parallel vacuum workers, even when a table had multiple large indexes. Although PostgreSQL already supported parallel vacuuming for manually executed VACUUM commands, this capability was not available to autovacuum . For example, manual vacuuming can use parallel workers: vahiddb= # VACUUM (PARALLEL 10) person; VACUUM PostgreSQL 19 introduces Parallel Autovacuum , allowing autovacuum to use parallel workers during index vacuuming and index cleanup. This feature is particularly useful for tables with large indexes and substantial numbers of dead tuples. However, it does not parallelize the table’s heap-scanning phase. Consequently, tables without indexes cannot benefit from this feature, and tables with large indexes are promising candidates. In this article, I will demonstrate the feature using a table containing five million rows and four indexes. I will compare the execution times of autovacuum with parallel worke...