{"Entry":{"collection":"guc","key":"autovacuum_worker_slots","name":"autovacuum_worker_slots","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":"17","status":"added","to":"18"}],"content_hash":"708fa705be0692cbeec3ae017f5609f75e51f7ec44b9cfe654a2441f24b101fb","context":"","default_changed_in":[],"default_history":[{"from":"18","to":"19","value":"16"}],"editorial":{"advice":{"olap":"Run explicit ANALYZE/VACUUM after bulk loads instead of waiting only for proportional triggers; plan freezing and visibility-map advancement separately for append-only partitions.","oltp":"Tune autovacuum_worker_slots from table size, change rate, and maintenance SLA, using per-table thresholds for large/hot relations. Observe trigger intervals, dead tuples, and ANALYZE/VACUUM duration.","small":"Start with upstream. Fixed thresholds dominate on small tables; after changes, confirm worker and I/O headroom."},"mechanism":["Sets the number of backend slots to allocate for autovacuum workers. The value is fixed when the server starts, so changing it requires a restart.","PG18 separates the startup allocation of backend slots for autovacuum workers from the active concurrency limit autovacuum_max_workers. The slots are reserved at startup so the worker limit can be reloaded within that allocation.","Monitor and change autovacuum_worker_slots together with autovacuum, autovacuum_naptime, autovacuum_max_workers. Validate on the relevant server role and real workload, then use its postmaster context to choose session change, reload, or restart; a historical boot default is not the current effective value."],"pitfalls":["Changing the global value while a table storage parameter overrides it.","Treating reltuples and cumulative change statistics as exact real-time counts.","Blaming a threshold without checking long transactions, replication slots, and worker saturation.","Buying short-term quiet by deferring maintenance until wraparound failsafe activates."],"references":[{"title":"PostgreSQL 19 Beta 4: autovacuum_worker_slots","url":"https://www.postgresql.org/docs/19/runtime-config-vacuum.html#GUC-AUTOVACUUM-WORKER-SLOTS"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["autovacuum","autovacuum_naptime","autovacuum_max_workers","autovacuum_work_mem","track_counts","autovacuum_analyze_scale_factor"],"summary":"autovacuum_worker_slots — Sets the number of backend slots to allocate for autovacuum workers. Observed in PG18–19 Beta 4; its last measured boot default is 16 in PG19 Beta 4, with postmaster context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"18","group":"Vacuuming","group_slug":"vacuum","imported_at":"2026-09-27T17:57:30.852413+08:00","intro_commit":{"authored_at":"2025-01-06T15:01:22-06:00","discussion":["https://postgr.es/m/20240410212344.GA1824549%40nathanxps13"],"hash":"c758119e5bfb47b38cf957f9a5a37ceae96fa9b3","subject":"Allow changing autovacuum_max_workers without restarting.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=c758119e5bfb47b38cf957f9a5a37ceae96fa9b3"},"key":"autovacuum_worker_slots","last_version":"20","max_val":"","min_val":"","name":"autovacuum_worker_slots","position":37,"present_in":["18","19","20"],"short_desc":"Specifies the number of backend slots to reserve for autovacuum worker processes.","short_desc_zh":"","source_rev":"english-manuals:af0b42c92a3f1178d6603e9172cde1793fce0a8d9c98ec538f466d4f3c5b9105","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"autovacuum_worker_slots","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"autovacuum_worker_slots","SourceRevision":"english-manuals:af0b42c92a3f1178d6603e9172cde1793fce0a8d9c98ec538f466d4f3c5b9105","Facts":{"boot_val":"16","category":"Vacuuming / Automatic Vacuuming","context":"postmaster","description":"Specifies the number of backend slots to reserve for autovacuum worker processes. The default is typically 16 slots, but might be less if your kernel settings will not support it (as determined during initdb). This parameter can only be set at server start. When changing this value, consider also adjusting autovacuum_max_workers.","doc":{"anchor":"GUC-AUTOVACUUM-WORKER-SLOTS","file":"runtime-config-vacuum.html","lang":"en","sha256":"7047f1fa9138b97f1812532f8a905fa7479451dfd64655e029a7d387b20b22e4","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"262143","metadata_version":"18","min_val":"1","name":"autovacuum_worker_slots","short_desc":"Sets the number of backend slots to allocate for autovacuum workers.","source":"pg-settings-source-snapshot","unit":null,"vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-AUTOVACUUM-WORKER-SLOTS","file":"runtime-config-vacuum.html","lang":"en","sha256":"7047f1fa9138b97f1812532f8a905fa7479451dfd64655e029a7d387b20b22e4","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"autovacuum_worker_slots","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"autovacuum_worker_slots","Summary":"","BodyHTML":"\u003cp\u003e指定为自动清理工作进程保留的后端槽位数。默认通常是 16 个槽位，但如果内核设置不支持（如 initdb 期间所判定），则可能少于此数。该参数只能在服务器启动时设置。\u003c/p\u003e\u003cp\u003e更改该值时，也应考虑调整\u003ca href=\"/docs/18/runtime-config-vacuum.html#GUC-AUTOVACUUM-MAX-WORKERS\" rel=\"nofollow\"\u003eautovacuum_max_workers\u003c/a\u003e。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"8b3bdbee84ce7baf686b1ba9112281cab0bcab43cdd03665280cbd88d5fd5ad2","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e指定为自动清理工作进程保留的后端槽位数。默认通常是 16 个槽位，但如果内核设置不支持（如 initdb 期间所判定），则可能少于此数。该参数只能在服务器启动时设置。\u003c/p\u003e\u003cp\u003e更改该值时，也应考虑调整\u003ca href=\"/docs/18/runtime-config-vacuum.html#GUC-AUTOVACUUM-MAX-WORKERS\"\u003eautovacuum_max_workers\u003c/a\u003e。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
