{"Entry":{"collection":"guc","key":"autovacuum_work_mem","name":"autovacuum_work_mem","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Resource Usage / Memory","category_zh":"","changed_in":["18"],"changes":[{"documentation_changed":false,"fields":{},"from":"9.3","status":"added","to":"9.4"},{"documentation_changed":true,"fields":{},"from":"9.5","status":"changed","to":"9.6"},{"documentation_changed":true,"fields":{},"from":"11","status":"changed","to":"12"},{"documentation_changed":true,"fields":{},"from":"16","status":"changed","to":"17"},{"documentation_changed":false,"fields":{"extra_desc":{"from":null,"to":"-1 means use \"maintenance_work_mem\"."}},"from":"17","status":"changed","to":"18"}],"content_hash":"93c06782c358b2283ae7bf294af7b89b969ed3ba44207a3d28c28468a512f017","context":"","default_changed_in":[],"default_history":[{"from":"9.4","to":"19","value":"-1 kB"}],"editorial":{"advice":{"olap":"Large relations may justify more memory per worker, but schedule and worker concurrency can dominate. Coordinate the value with autovacuum_max_workers and the maintenance window.","oltp":"When maintenance_work_mem is large, set an explicit lower autovacuum ceiling unless the concurrent-worker budget clearly fits. Watch vacuum duration, dead-tuple backlog, and latency before increasing it.","small":"Keep -1 only when maintenance_work_mem is itself conservative; otherwise set a smaller explicit value to prevent several workers from exhausting the host."},"mechanism":["autovacuum_work_mem applies separately to each autovacuum worker process. The default sentinel -1 means to use maintenance_work_mem rather than negative memory.","The setting affects autovacuum workers only; it does not change manually issued VACUUM. It is a SIGHUP-context parameter, so it is configured at server level rather than as a per-session tuning knob.","Because multiple workers can run concurrently, the aggregate potential allocation is the per-worker value multiplied by active autovacuum workers. Memory is only one part of vacuum behavior; I/O throttling, worker count, thresholds, and table activity also matter."],"pitfalls":["Reading -1 as a literal negative kilobyte value instead of an inheritance sentinel.","Assuming the setting controls manual VACUUM.","Budgeting one worker while several autovacuum workers can run at once.","Increasing memory to address a vacuum problem actually caused by I/O throttling, thresholds, locks, or insufficient worker capacity."],"references":[{"title":"PostgreSQL 19 Beta 4: autovacuum_work_mem","url":"https://www.postgresql.org/docs/19/runtime-config-resource.html#GUC-AUTOVACUUM-WORK-MEM"},{"title":"PostgreSQL 18: 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":["maintenance_work_mem","autovacuum_max_workers","autovacuum_worker_slots","vacuum_buffer_usage_limit","autovacuum_vacuum_cost_delay"],"summary":"The memory ceiling for each autovacuum worker, with -1 meaning that the worker inherits maintenance_work_mem."},"enumvals":[],"first_version":"9.4","group":"Resource Usage","group_slug":"resource","imported_at":"2026-09-27T17:57:30.848978+08:00","intro_commit":{"authored_at":"2013-12-12T11:42:39Z","discussion":[],"hash":"8693559cacf1765697c32fc38574af3c19ce61c1","subject":"New autovacuum_work_mem parameter","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=8693559cacf1765697c32fc38574af3c19ce61c1"},"key":"autovacuum_work_mem","last_version":"20","max_val":"","min_val":"","name":"autovacuum_work_mem","position":36,"present_in":["9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"short_desc":"Specifies the maximum amount of memory to be used by each autovacuum worker process.","short_desc_zh":"","source_rev":"english-manuals:00d0b058cd616503f7688c592bd2c0f526a4e6d31ccc0420d1a4ed3fa3295298","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"autovacuum_work_mem","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"autovacuum_work_mem","SourceRevision":"english-manuals:00d0b058cd616503f7688c592bd2c0f526a4e6d31ccc0420d1a4ed3fa3295298","Facts":{"boot_val":"-1","category":"Resource Usage / Memory","context":"sighup","description":"Specifies the maximum amount of memory to be used by each autovacuum worker process. If this value is specified without units, it is taken as kilobytes. It defaults to -1, indicating that the value of maintenance_work_mem should be used instead. The setting has no effect on the behavior of VACUUM when run in other contexts. This parameter can only be set in the postgresql.conf file or on the server command line.","doc":{"anchor":"GUC-AUTOVACUUM-WORK-MEM","file":"runtime-config-resource.html","lang":"en","sha256":"2e207c599f0884dfbe594558c478a2c7c132578981071e980e2015f31dfce28c","slug":"18"},"documented":true,"enumvals":null,"extra_desc":"-1 means use \"maintenance_work_mem\".","lang":"en","max_val":"2147483647","metadata_version":"18","min_val":"-1","name":"autovacuum_work_mem","short_desc":"Sets the maximum memory to be used by each autovacuum worker process.","source":"pg-settings-source-snapshot","unit":"kB","vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-AUTOVACUUM-WORK-MEM","file":"runtime-config-resource.html","lang":"en","sha256":"2e207c599f0884dfbe594558c478a2c7c132578981071e980e2015f31dfce28c","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"autovacuum_work_mem","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"autovacuum_work_mem","Summary":"","BodyHTML":"\u003cp\u003e指定每个自动清理工作进程可使用的最大内存量。如果未指定单位，则以千字节为单位。默认值为 -1，表示改用\u003ca href=\"/docs/18/runtime-config-resource.html#GUC-MAINTENANCE-WORK-MEM\" rel=\"nofollow\"\u003emaintenance_work_mem\u003c/a\u003e的值。该设置不影响其他上下文中运行的 \u003ccode\u003eVACUUM\u003c/code\u003e 的行为。此参数只能在 \u003ccode\u003epostgresql.conf\u003c/code\u003e 文件中或服务器命令行上设置。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"526527df5136f2cc1ec8297fd2346a565a43f3a2be090fd0f9207c6be78b326a","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e指定每个自动清理工作进程可使用的最大内存量。如果未指定单位，则以千字节为单位。默认值为 -1，表示改用\u003ca href=\"/docs/18/runtime-config-resource.html#GUC-MAINTENANCE-WORK-MEM\"\u003emaintenance_work_mem\u003c/a\u003e的值。该设置不影响其他上下文中运行的 \u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e 的行为。此参数只能在 \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e 文件中或服务器命令行上设置。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
