{"Entry":{"collection":"guc","key":"min_wal_size","name":"min_wal_size","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Write-Ahead Log / Checkpoints","category_zh":"","changed_in":["10"],"changes":[{"documentation_changed":false,"fields":{},"from":"9.4","status":"added","to":"9.5"},{"documentation_changed":false,"fields":{"boot_val":{"from":"5","to":"80"},"unit":{"from":"16MB","to":"MB"}},"from":"9.6","status":"changed","to":"10"},{"documentation_changed":true,"fields":{},"from":"11","status":"changed","to":"12"}],"content_hash":"835a0d08d461ad7b77f52bd5f2ce1945ef5865a354d38fe9de165ea0f8ea177d","context":"","default_changed_in":["10"],"default_history":[{"from":"9.5","to":"9.6","value":"80 MiB (5 × 16MB)"},{"from":"10","to":"19","value":"80 MiB"}],"editorial":{"advice":{"olap":"Large batch loads may benefit from a bigger reusable pool, but derive it from repeatable batch peaks rather than copying an arbitrary GB value; archive and slot retention are separate.","oltp":"Size the recycled-segment floor from ordinary WAL generated between checkpoints and measured file-creation cost. Keep it well below available pg_wal space and evaluate it together with max_wal_size.","small":"It is not free on a small volume; lowering it trades space for more segment create/remove churn."},"mechanism":["Sets the minimum size to shrink the WAL to. A configuration reload applies a new value; existing work already in flight is not retroactively changed.","Below this floor, checkpoint recycling keeps old segment files ready for reuse instead of removing them. It is a retained/recycled space floor, not a cap; archive failures, replication slots, wal_keep_size, and max_wal_size can all make pg_wal much larger.","Monitor and change min_wal_size together with max_wal_size, wal_keep_size, wal_segment_size. 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":["Reading it as a maximum pg_wal size.","Sizing it without wal_segment_size rounding and burst rate.","Ignoring archive/slot retention that can exceed both min_wal_size and max_wal_size.","Confusing pg_settings base units with human-readable configuration units.","Benchmarking throughput without a crash-recovery and archive-restore test."],"references":[{"title":"PostgreSQL 19 Beta 4: min_wal_size","url":"https://www.postgresql.org/docs/19/runtime-config-wal.html#GUC-MIN-WAL-SIZE"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["max_wal_size","wal_keep_size","wal_segment_size","checkpoint_timeout","checkpoint_completion_target","checkpoint_flush_after"],"summary":"min_wal_size — Sets the minimum size to shrink the WAL to. Observed in PG9.5–19 Beta 4; its last measured boot default is 80 MiB in PG19 Beta 4, with sighup context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"9.5","group":"Write-Ahead Log","group_slug":"wal","imported_at":"2026-09-27T17:57:31.786689+08:00","intro_commit":{"authored_at":"2015-02-23T18:53:02+02:00","discussion":[],"hash":"88e982302684246e8af785e78a467ac37c76dee9","subject":"Replace checkpoint_segments with min_wal_size and max_wal_size.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=88e982302684246e8af785e78a467ac37c76dee9"},"key":"min_wal_size","last_version":"20","max_val":"","min_val":"","name":"min_wal_size","position":297,"present_in":["9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"short_desc":"As long as WAL disk usage stays below this setting, old WAL files are always recycled for future use at a checkpoint, rather than removed.","short_desc_zh":"","source_rev":"english-manuals:7b23f5849efe072f26763297f756e0d74c383760092311a64723e439965f8396","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"min_wal_size","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"min_wal_size","SourceRevision":"english-manuals:7b23f5849efe072f26763297f756e0d74c383760092311a64723e439965f8396","Facts":{"boot_val":"80","category":"Write-Ahead Log / Checkpoints","context":"sighup","description":"As long as WAL disk usage stays below this setting, old WAL files are always recycled for future use at a checkpoint, rather than removed. This can be used to ensure that enough WAL space is reserved to handle spikes in WAL usage, for example when running large batch jobs. If this value is specified without units, it is taken as megabytes. The default is 80 MB. This parameter can only be set in the postgresql.conf file or on the server command line.","doc":{"anchor":"GUC-MIN-WAL-SIZE","file":"runtime-config-wal.html","lang":"en","sha256":"d2646404a06e8f7ac655204b4f28c049ae8f3fd4f2272db080fcefa2c4af0763","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"2147483647","metadata_version":"18","min_val":"2","name":"min_wal_size","short_desc":"Sets the minimum size to shrink the WAL to.","source":"pg-settings-source-snapshot","unit":"MB","vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-MIN-WAL-SIZE","file":"runtime-config-wal.html","lang":"en","sha256":"d2646404a06e8f7ac655204b4f28c049ae8f3fd4f2272db080fcefa2c4af0763","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"min_wal_size","SourceDatabase":"center","Version":"18","Locale":"en","Title":"min_wal_size","Summary":"As long as WAL disk usage stays below this setting, old WAL files are always recycled for future use at a checkpoint, rather than removed. This can be used to ensure that enough WAL space is reserved to handle spikes in WAL usage, for example when running large batch jobs. If this value is specified without units, it is taken as megabytes. The default is 80 MB. This parameter can only be set in the postgresql.conf file or on the server command line.","BodyHTML":"\u003cp\u003eAs long as WAL disk usage stays below this setting, old WAL files are always recycled for future use at a checkpoint, rather than removed. This can be used to ensure that enough WAL space is reserved to handle spikes in WAL usage, for example when running large batch jobs. If this value is specified without units, it is taken as megabytes. The default is 80 MB. This parameter can only be set in the postgresql.conf file or on the server command line.\u003c/p\u003e","SourceRevision":"english-manuals:7b23f5849efe072f26763297f756e0d74c383760092311a64723e439965f8396","ContentHash":"98f91c8fab37c8be27a7ceda1a32ec35924b16156b5215881f18de7cd46aa6a6","Payload":{"description":"As long as WAL disk usage stays below this setting, old WAL files are always recycled for future use at a checkpoint, rather than removed. This can be used to ensure that enough WAL space is reserved to handle spikes in WAL usage, for example when running large batch jobs. If this value is specified without units, it is taken as megabytes. The default is 80 MB. This parameter can only be set in the postgresql.conf file or on the server command line."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.5","9.6"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
