{"Entry":{"collection":"guc","key":"autovacuum_vacuum_max_threshold","name":"autovacuum_vacuum_max_threshold","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":"a7ca44ba261ccc4e3cddf9d8177b447e0d3b3df2c22d331144d21a6ff67aa78a","context":"","default_changed_in":[],"default_history":[{"from":"18","to":"19","value":"100000000"}],"derived_content_hash":"364a177c485fb96ed67af8ece2cf7555aded3fed9d946553e628d0a8b0496874","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:2722f74f230080a7cf1979453b59c6a4f50ab0290887750309cdc6947658afdd","versions":{"18":"18.7","19":"19rc2"}},"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_vacuum_max_threshold 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":["Maximum number of tuple updates or deletes prior to vacuum. A configuration reload applies a new value; existing work already in flight is not retroactively changed.","The ordinary automatic-vacuum threshold is the base term plus scale factor times reltuples, capped by autovacuum_vacuum_max_threshold from PG18. It reacts to dead tuples from updates/deletes, permits per-table overrides, and is separate from mandatory anti-wraparound vacuuming.","Monitor and change autovacuum_vacuum_max_threshold together with autovacuum_vacuum_threshold, autovacuum_vacuum_scale_factor, autovacuum_vacuum_insert_threshold. Validate on the relevant server role and real workload, then use its sighup 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_vacuum_max_threshold","url":"https://www.postgresql.org/docs/19/runtime-config-vacuum.html#GUC-AUTOVACUUM-VACUUM-MAX-THRESHOLD"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["autovacuum_vacuum_threshold","autovacuum_vacuum_scale_factor","autovacuum_vacuum_insert_threshold","autovacuum_vacuum_insert_scale_factor","autovacuum","autovacuum_analyze_scale_factor"],"summary":"autovacuum_vacuum_max_threshold — Maximum number of tuple updates or deletes prior to vacuum. Observed in PG18–19 Beta 4; its last measured boot default is 100000000 in PG19 Beta 4, with sighup 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.83658+08:00","intro_commit":{"authored_at":"2025-02-05T15:48:18-06:00","discussion":["https://postgr.es/m/956435f8-3b2f-47a6-8756-8c54ded61802%40dalibo.com"],"hash":"306dc520b9dfd6014613961962a89940a431a069","subject":"Introduce autovacuum_vacuum_max_threshold.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=306dc520b9dfd6014613961962a89940a431a069"},"key":"autovacuum_vacuum_max_threshold","last_version":"20","max_val":"","min_val":"","name":"autovacuum_vacuum_max_threshold","position":32,"present_in":["18","19","20"],"repair_provenance":{"original_source_revision":"english-manuals:759c54f1471bde9cc85361b4593c7ce909bf16adc3c3f250c6e695e89eed6874","receipt_sha256":"dad0f3814f60ecfca789ea867d798213d811d5a5cd991bcbb7845806c24422cd","repair":"wiki-repair-20261023"},"short_desc":"Specifies the maximum number of updated or deleted tuples needed to trigger a VACUUM in any one table, i.e., a limit on the value calculated with autovacuum_vacuum_threshold and autovacuum_vacuum_scale_factor.","short_desc_zh":"","source_rev":"wiki-repair-20261023:2722f74f230080a7cf1979453b59c6a4f50ab0290887750309cdc6947658afdd","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"autovacuum_vacuum_max_threshold","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"autovacuum_vacuum_max_threshold","SourceRevision":"wiki-repair-20261023:2722f74f230080a7cf1979453b59c6a4f50ab0290887750309cdc6947658afdd","Facts":{"boot_val":"100000000","category":"Vacuuming / Automatic Vacuuming","context":"sighup","description":"Specifies the maximum number of updated or deleted tuples needed to trigger a VACUUM in any one table, i.e., a limit on the value calculated with autovacuum_vacuum_threshold and autovacuum_vacuum_scale_factor. The default is 100,000,000 tuples. If -1 is specified, autovacuum will not enforce a maximum number of updated or deleted tuples that will trigger a VACUUM operation. This parameter can only be set in the postgresql.conf file or on the server command line; but the setting can be overridden for individual tables by changing storage parameters.","description_zh":"指定在任意一个表上触发 VACUUM 所需更新或删除元组数的最大值，也就是对 autovacuum_vacuum_threshold 和 autovacuum_vacuum_scale_factor 计算结果所施加的上限。默认值为 100,000,000 个元组。如果指定为 -1，自动清理将不会对触发 VACUUM 所需的更新或删除元组数强制施加最大值。该参数只能在 postgresql.conf 文件中或服务器命令行上设置；但可以通过更改表存储参数覆盖单个表的该设置。","description_zh_html":"\u003cp\u003e\n\t        指定在任意一个表上触发 \u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e 所需更新或删除元组数的最大值，也就是对\n\t        \u003ccode class=\"varname\"\u003eautovacuum_vacuum_threshold\u003c/code\u003e 和\n\t        \u003ccode class=\"varname\"\u003eautovacuum_vacuum_scale_factor\u003c/code\u003e 计算结果所施加的上限。默认值为 100,000,000 个元组。如果指定为 \u003ccode class=\"literal\"\u003e-1\u003c/code\u003e，自动清理将不会对触发\n\t        \u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e 所需的更新或删除元组数强制施加最大值。该参数只能在 \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e 文件中或服务器命令行上设置；但可以通过更改表存储参数覆盖单个表的该设置。\n\t       \u003c/p\u003e","doc":{"anchor":"GUC-AUTOVACUUM-VACUUM-MAX-THRESHOLD","file":"runtime-config-vacuum.html","lang":"en","sha256":"599d3819c5fa60f160ba633df604ee9afd85549ffad2ae2fb0c3132a00d47417","slug":"18"},"doc_html":"\u003cp\u003e\n         Specifies the maximum number of updated or deleted tuples needed to\n         trigger a \u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e in any one table, i.e., a limit on\n         the value calculated with\n         \u003ccode class=\"varname\"\u003eautovacuum_vacuum_threshold\u003c/code\u003e and\n         \u003ccode class=\"varname\"\u003eautovacuum_vacuum_scale_factor\u003c/code\u003e.  The default is\n         100,000,000 tuples.  If -1 is specified, autovacuum will not enforce a\n         maximum number of updated or deleted tuples that will trigger a\n         \u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e operation.  This parameter can only be set\n         in the \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e file or on the server\n         command line; but the setting can be overridden for individual tables\n         by changing storage parameters.\n        \u003c/p\u003e","doc_same_as":"","documentation_revision":{"inputs":[{"file":"runtime-config-vacuum.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"599d3819c5fa60f160ba633df604ee9afd85549ffad2ae2fb0c3132a00d47417","version":"18.7"},{"file":"runtime-config-vacuum.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"b835e4b6c446cfdaf673750aba29ba28fc55ef6cc0c531558c1e394fdc05a140","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"documented":true,"enumvals":null,"extra_desc":"-1 disables the maximum threshold.","lang":"en","max_val":"2147483647","metadata_version":"18","min_val":"-1","name":"autovacuum_vacuum_max_threshold","short_desc":"Maximum number of tuple updates or deletes prior to vacuum.","source":"pg-settings-source-snapshot","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-vacuum.html","sha256":"ea621aa6ed500fc56d21868a21fd313872cec24b86caf4c8f9bdfdc804b8235f"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"integer","zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"GUC-AUTOVACUUM-VACUUM-MAX-THRESHOLD","file":"runtime-config-vacuum.html","lang":"en","sha256":"599d3819c5fa60f160ba633df604ee9afd85549ffad2ae2fb0c3132a00d47417","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"autovacuum_vacuum_max_threshold","SourceDatabase":"center","Version":"18","Locale":"en","Title":"autovacuum_vacuum_max_threshold","Summary":"Specifies the maximum number of updated or deleted tuples needed to trigger a VACUUM in any one table, i.e., a limit on the value calculated with autovacuum_vacuum_threshold and autovacuum_vacuum_scale_factor. The default is 100,000,000 tuples. If -1 is specified, autovacuum will not enforce a maximum number of updated or deleted tuples that will trigger a VACUUM operation. This parameter can only be set in the postgresql.conf file or on the server command line; but the setting can be overridden for individual tables by changing storage parameters.","BodyHTML":"\u003cp\u003e\n         Specifies the maximum number of updated or deleted tuples needed to\n         trigger a \u003ccode\u003eVACUUM\u003c/code\u003e in any one table, i.e., a limit on\n         the value calculated with\n         \u003ccode\u003eautovacuum_vacuum_threshold\u003c/code\u003e and\n         \u003ccode\u003eautovacuum_vacuum_scale_factor\u003c/code\u003e.  The default is\n         100,000,000 tuples.  If -1 is specified, autovacuum will not enforce a\n         maximum number of updated or deleted tuples that will trigger a\n         \u003ccode\u003eVACUUM\u003c/code\u003e operation.  This parameter can only be set\n         in the \u003ccode\u003epostgresql.conf\u003c/code\u003e file or on the server\n         command line; but the setting can be overridden for individual tables\n         by changing storage parameters.\n        \u003c/p\u003e","SourceRevision":"wiki-repair-20261023:2722f74f230080a7cf1979453b59c6a4f50ab0290887750309cdc6947658afdd","ContentHash":"4ee22af3d9afb07f7d6b13bdc5f3cbbe5fe7274e6160dd792a5526d7a36a3af1","Payload":{"description":"Specifies the maximum number of updated or deleted tuples needed to trigger a VACUUM in any one table, i.e., a limit on the value calculated with autovacuum_vacuum_threshold and autovacuum_vacuum_scale_factor. The default is 100,000,000 tuples. If -1 is specified, autovacuum will not enforce a maximum number of updated or deleted tuples that will trigger a VACUUM operation. This parameter can only be set in the postgresql.conf file or on the server command line; but the setting can be overridden for individual tables by changing storage parameters."}},"RequestedLocale":"en","Fallback":false,"Versions":["18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
