{"Entry":{"collection":"guc","key":"autovacuum","name":"autovacuum","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Vacuuming / Automatic Vacuuming","category_zh":"","changed_in":["18"],"changes":[{"documentation_changed":false,"fields":{},"from":"8.0","status":"added","to":"8.1"},{"documentation_changed":true,"fields":{},"from":"8.1","status":"changed","to":"8.2"},{"documentation_changed":true,"fields":{},"from":"8.2","status":"changed","to":"8.3"},{"documentation_changed":true,"fields":{},"from":"8.3","status":"changed","to":"8.4"},{"documentation_changed":true,"fields":{},"from":"8.4","status":"changed","to":"9.0"},{"documentation_changed":true,"fields":{},"from":"9.1","status":"changed","to":"9.2"},{"documentation_changed":true,"fields":{},"from":"9.4","status":"changed","to":"9.5"},{"documentation_changed":true,"fields":{},"from":"9.5","status":"changed","to":"9.6"},{"documentation_changed":true,"fields":{},"from":"13","status":"changed","to":"14"},{"documentation_changed":true,"fields":{},"from":"16","status":"changed","to":"17"},{"documentation_changed":false,"fields":{"category":{"from":"Autovacuum","to":"Vacuuming / Automatic Vacuuming"}},"from":"17","status":"changed","to":"18"}],"content_hash":"2f947191f1b27a1bcc8ca0def118f57eb1ed0fc22c53cd7e838d94fc69074a45","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"on"}],"editorial":{"advice":{"olap":"Keep it on for safety, but coordinate it with bulk-load windows. Run explicit ANALYZE after large loads and on partitioned parents when planner statistics must be immediately current.","oltp":"Keep it on. Tune busy tables individually, then watch dead tuples, autovacuum duration, canceled workers, and XID age before changing global aggressiveness.","small":"Leave the default on. Reducing worker count or per-table aggressiveness is safer than disabling the launcher merely to save a small amount of background activity."},"mechanism":["When enabled, one launcher coordinates worker processes across databases. Workers use cumulative table-change statistics, so track_counts must also be enabled, and they run VACUUM or ANALYZE when a table crosses the relevant thresholds.","Ordinary vacuum triggers react to inserted, updated, and deleted tuples. Separately, PostgreSQL can launch anti-wraparound autovacuums even when this switch is off, because allowing old transaction IDs or multixact IDs to wrap would threaten correctness.","Most trigger and cost settings can be overridden per table through storage parameters. Temporary tables are outside autovacuum's reach, and partitioned parent tables can still need manual ANALYZE even though their partitions are processed normally."],"pitfalls":["Turning it off does not disable emergency anti-wraparound vacuuming.","track_counts must be on for ordinary autovacuum decisions to work.","Long transactions and stale replication slots can prevent cleanup even when workers run successfully.","Autovacuum does not analyze partitioned parent tables solely because their partitions changed.","Temporary tables require maintenance from the owning session."],"references":[{"title":"PostgreSQL 19 Beta 4: autovacuum","url":"https://www.postgresql.org/docs/19/runtime-config-vacuum.html#GUC-AUTOVACUUM"},{"title":"PostgreSQL 18: Routine Vacuuming and the Autovacuum Daemon","url":"https://www.postgresql.org/docs/18/routine-vacuuming.html#AUTOVACUUM"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["autovacuum_max_workers","autovacuum_naptime","autovacuum_vacuum_scale_factor","autovacuum_analyze_scale_factor","autovacuum_freeze_max_age","track_counts"],"summary":"Autovacuum keeps MVCC tables usable by scheduling background VACUUM and ANALYZE work. It is both a performance mechanism and a wraparound safety net, not optional cosmetic housekeeping."},"enumvals":[],"first_version":"8.1","group":"Vacuuming","group_slug":"vacuum","imported_at":"2026-09-27T17:57:30.781447+08:00","intro_commit":{},"key":"autovacuum","last_version":"20","max_val":"","min_val":"","name":"autovacuum","position":16,"present_in":["8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"short_desc":"Controls whether the server should run the autovacuum launcher daemon.","short_desc_zh":"","source_rev":"english-manuals:6abd109e9215fa3ad76bf281b6054d00a1e98297c1102a618f603645d2f85f56","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"autovacuum","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"autovacuum","SourceRevision":"english-manuals:6abd109e9215fa3ad76bf281b6054d00a1e98297c1102a618f603645d2f85f56","Facts":{"boot_val":"on","category":"Vacuuming / Automatic Vacuuming","context":"sighup","description":"Controls whether the server should run the autovacuum launcher daemon. This is on by default; however, track_counts must also be enabled for autovacuum to work. This parameter can only be set in the postgresql.conf file or on the server command line; however, autovacuuming can be disabled for individual tables by changing table storage parameters. Note that even when this parameter is disabled, the system will launch autovacuum processes if necessary to prevent transaction ID wraparound. See Section 24.1.5 for more information.","doc":{"anchor":"GUC-AUTOVACUUM","file":"runtime-config-vacuum.html","lang":"en","sha256":"7047f1fa9138b97f1812532f8a905fa7479451dfd64655e029a7d387b20b22e4","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"autovacuum","short_desc":"Starts the autovacuum subprocess.","source":"pg-settings-source-snapshot","unit":null,"vartype":"bool"},"ManualEvidence":{"doc":{"anchor":"GUC-AUTOVACUUM","file":"runtime-config-vacuum.html","lang":"en","sha256":"7047f1fa9138b97f1812532f8a905fa7479451dfd64655e029a7d387b20b22e4","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"autovacuum","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"autovacuum","Summary":"","BodyHTML":"\u003cp\u003e控制服务器是否运行自动清理启动器后台进程。默认为开启，不过要使自动清理正常工作，还需要启用\u003ca href=\"/docs/18/runtime-config-statistics.html#GUC-TRACK-COUNTS\" rel=\"nofollow\"\u003etrack_counts\u003c/a\u003e。该参数只能在\u003ccode\u003epostgresql.conf\u003c/code\u003e文件或服务器命令行中设置，不过，通过更改表存储参数可以为表禁用自动清理。\u003c/p\u003e\u003cp\u003e注意即使该参数被禁用，系统也会在需要防止事务ID回卷时发起自动清理进程。详情请见\u003ca href=\"/docs/18/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND\" rel=\"nofollow\"\u003e第 24.1.5 节\u003c/a\u003e。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"b935924a981dbc285599b9206cc4073d5ceba0f67d0e00a16b0b844849f37c19","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e控制服务器是否运行自动清理启动器后台进程。默认为开启，不过要使自动清理正常工作，还需要启用\u003ca href=\"/docs/18/runtime-config-statistics.html#GUC-TRACK-COUNTS\"\u003etrack_counts\u003c/a\u003e。该参数只能在\u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e文件或服务器命令行中设置，不过，通过更改表存储参数可以为表禁用自动清理。\u003c/p\u003e\u003cp\u003e注意即使该参数被禁用，系统也会在需要防止事务ID回卷时发起自动清理进程。详情请见\u003ca href=\"/docs/18/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND\" title=\"24.1.5. 防止事务 ID 回卷失败\"\u003e第 24.1.5 节\u003c/a\u003e。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
