{"Entry":{"collection":"guc","key":"autovacuum_max_parallel_workers","name":"autovacuum_max_parallel_workers","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Vacuuming / Automatic Vacuuming","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"18","status":"added","to":"19"},{"documentation_changed":true,"fields":{},"from":"19","status":"changed","to":"20"}],"content_hash":"f60573cf2ca2e5a92a4ada9b0c7a7fd26e44a070e71c945925b78b8457d983ee","context":"","default_changed_in":[],"default_history":[{"from":"19","to":"19","value":"0"}],"editorial":{"advice":{"olap":"Batch-heavy systems can benefit from prioritizing the largest maintenance debt or parallelizing index cleanup, but benchmark I/O saturation, maintenance memory, worker contention, and completion time across the whole maintenance window.","oltp":"Start at the upstream default and use pg_stat_autovacuum_scores, table churn, freeze age, queueing, and foreground latency to justify a change. Protect wraparound work and avoid letting a busy-table preference starve quieter tables.","small":"Keep weights and parallelism conservative. One extra worker can be a large share of CPU, RAM, and storage queue depth; first fix thresholds and ensure autovacuum has enough time to finish."},"mechanism":["PostgreSQL describes autovacuum_max_parallel_workers as follows: “Maximum number of parallel workers that can be used by a single autovacuum worker.” A configuration reload applies the value to the server without a full restart. The atlas measures it in PG19 Beta 3; boot_val is the compiled or initialized baseline, not proof of a running cluster's effective setting.","The limit applies per autovacuum worker and only to index vacuuming and index-cleanup phases. Zero disables parallel autovacuum; the actual count is also capped by max_parallel_workers, while each participating worker consumes CPU and maintenance memory.","Read it together with autovacuum_max_workers, autovacuum_worker_slots, max_parallel_workers, maintenance_work_mem. Check SHOW and pg_settings on the target server, verify the source and pending_restart fields, and compare workload, logs, and resource metrics before and after any change."],"pitfalls":["Treating the measured boot_val for autovacuum_max_parallel_workers as proof of the effective value on an initialized or managed cluster.","Applying a change as though it were immediate while pg_settings reports sighup context.","Changing this setting in isolation without checking the linked limits, observability, and rollback path.","Depending on beta behavior in production without retesting the PostgreSQL 19 final release."],"references":[{"title":"PostgreSQL 19 Beta 4: autovacuum_max_parallel_workers","url":"https://www.postgresql.org/docs/19/runtime-config-vacuum.html#GUC-AUTOVACUUM-MAX-PARALLEL-WORKERS"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["autovacuum_max_workers","autovacuum_worker_slots","max_parallel_workers","maintenance_work_mem","autovacuum_work_mem"],"summary":"autovacuum_max_parallel_workers — Maximum number of parallel workers that can be used by a single autovacuum worker. Observed in PG19 Beta 4; its last measured boot default is 0 in PG19 Beta 4, with sighup context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"19","group":"Vacuuming","group_slug":"vacuum","imported_at":"2026-09-27T17:57:30.800231+08:00","intro_commit":{"authored_at":"2026-04-06T11:48:29-07:00","discussion":["https://postgr.es/m/CACG=ezZOrNsuLoETLD1gAswZMuH2nGGq7Ogcc0QOE5hhWaw=cw@mail.gmail.com"],"hash":"1ff3180ca0169556984ab83759477f593129794d","subject":"Allow autovacuum to use parallel vacuum workers.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=1ff3180ca0169556984ab83759477f593129794d"},"key":"autovacuum_max_parallel_workers","last_version":"20","max_val":"","min_val":"","name":"autovacuum_max_parallel_workers","position":22,"present_in":["19","20"],"short_desc":"Sets the maximum number of parallel workers that can be used by a single autovacuum worker to process indexes.","short_desc_zh":"","source_rev":"english-manuals:7cd3f8a654529a21efea8246a1f767a45d3fc29600486b022b96274970a7a3d7","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"autovacuum_max_parallel_workers","SourceDatabase":"center","Version":"20","SourceTable":"guc","SourceKey":"autovacuum_max_parallel_workers","SourceRevision":"english-manuals:7cd3f8a654529a21efea8246a1f767a45d3fc29600486b022b96274970a7a3d7","Facts":{"boot_val":null,"category":"Automatic Vacuuming","context":"","description":"Sets the maximum number of parallel workers that can be used by a single autovacuum worker to process indexes. This limit applies specifically to the index vacuuming and index cleanup phases (for the details of each autovacuum phase, please refer to Table 27.52). The actual number of parallel workers is further limited by max_parallel_workers. This is the per-autovacuum worker equivalent of the PARALLEL option of the VACUUM command. Setting this value to 0 disables parallel vacuum during autovacuum. The default is 0.","doc":{"anchor":"GUC-AUTOVACUUM-MAX-PARALLEL-WORKERS","file":"runtime-config-vacuum.html","lang":"en","sha256":"30e406323d744a69a54900ecb606fcabcf5c63c344644b82f72a45f8e0d9265d","slug":"devel"},"documented":true,"enumvals":[],"extra_desc":"","lang":"en","max_val":null,"metadata_version":"","min_val":null,"name":"autovacuum_max_parallel_workers","short_desc":"","source":"english-manual","unit":"","vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-AUTOVACUUM-MAX-PARALLEL-WORKERS","file":"runtime-config-vacuum.html","lang":"en","sha256":"30e406323d744a69a54900ecb606fcabcf5c63c344644b82f72a45f8e0d9265d","slug":"devel"}},"MeasuredEvidence":{"metadata_version":""}},"Text":{"Collection":"guc","Key":"autovacuum_max_parallel_workers","SourceDatabase":"pgweb","Version":"20","Locale":"zh-Hans","Title":"autovacuum_max_parallel_workers","Summary":"","BodyHTML":"\u003cp\u003e设置单个自动清理工作进程在处理索引时可使用的并行工作进程最大数量。此限制只适用于索引清理（index vacuuming）和索引收尾清理（index cleanup）阶段（有关自动清理各阶段的细节，请参见\u003ca href=\"/docs/devel/progress-reporting.html#VACUUM-PHASES\" rel=\"nofollow\"\u003e表 27.52\u003c/a\u003e）。实际可用的并行工作进程数量还会进一步受到\u003ca href=\"/docs/devel/runtime-config-resource.html#GUC-MAX-PARALLEL-WORKERS\" rel=\"nofollow\"\u003emax_parallel_workers\u003c/a\u003e的限制。它相当于每个自动清理工作进程上的\u003ca href=\"/docs/devel/sql-vacuum.html\" title=\"VACUUM\" rel=\"nofollow\"\u003e\u003ccode\u003eVACUUM\u003c/code\u003e\u003c/a\u003e命令\u003ccode\u003ePARALLEL\u003c/code\u003e选项。将该值设为 0 会在自动清理期间禁用并行清理。默认值为 0。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"26b30989dd3ed4fa8eb46c266837f6af86598336f09b331a4127e1a4c5367f6c","Payload":{"carried_from":"19","carry_reason":"手册不含 pg_settings 事实，沿用 19","doc_html":"\u003cp\u003e设置单个自动清理工作进程在处理索引时可使用的并行工作进程最大数量。此限制只适用于索引清理（index vacuuming）和索引收尾清理（index cleanup）阶段（有关自动清理各阶段的细节，请参见\u003ca href=\"/docs/devel/progress-reporting.html#VACUUM-PHASES\" title=\"表 27.52. VACUUM 阶段\"\u003e表 27.52\u003c/a\u003e）。实际可用的并行工作进程数量还会进一步受到\u003ca href=\"/docs/devel/runtime-config-resource.html#GUC-MAX-PARALLEL-WORKERS\"\u003emax_parallel_workers\u003c/a\u003e的限制。它相当于每个自动清理工作进程上的\u003ca href=\"/docs/devel/sql-vacuum.html\" title=\"VACUUM\"\u003e\u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e\u003c/a\u003e命令\u003ccode class=\"literal\"\u003ePARALLEL\u003c/code\u003e选项。将该值设为 0 会在自动清理期间禁用并行清理。默认值为 0。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
