# min_wal_size

> min_wal_size — Sets the minimum size to shrink the WAL to. Observed in PG9.5–19 Beta 3; its last measured boot default is 80 MiB in PG19 Beta 3, with sighup context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.
---

> [!NOTE]
> **Fact — official short description:** “Sets the minimum size to shrink the WAL to.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `integer` | Upstream pg_settings type |
| Context | `sighup` | Takes effect after configuration reload |
| Unit | `MB` | Raw unit |
| Range | `2` – `2147483647` | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Write-Ahead Log / Checkpoints | Upstream classification |
| Latest boot value | `80` | 80 MiB |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG9.5 |
| Present in | PG9.5–19 Beta 3 |
| Removed in | No |
| Introduction commit | [`88e982302684`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=88e982302684246e8af785e78a467ac37c76dee9) — Replace checkpoint_segments with min_wal_size and max_wal_size. |
| Commit date | 2015-02-23 |
| Discussion | — |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG9.5–9.6 | `5` | `16MB` | 80 MiB (5 × 16MB) |
| PG10–19 Beta 3 | `80` | `MB` | 80 MiB |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#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.

## Tuning advice {#tuning-advice}

> [!TIP]
> **Advice.** These are workload-specific starting points and must be validated with measurements.

| Workload | Guidance |
| --- | --- |
| 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. |
| 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. |
| Small nodes | Verify that Pigsty's measured 5GB matrix value fits the actual disk. It is not free on a small volume; lowering it trades space for more segment create/remove churn. |
{.full-width}

## Pigsty {#pigsty}

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

| Template | Effective value | Versus upstream boot | Source expression |
| --- | --- | --- | --- |
| OLTP | `5GB` | different | `{{ ([pg_size_twentieth, 200])\|min }}GB` |
| OLAP | `5GB` | different | `{{ ([pg_size_twentieth, 200])\|min }}GB` |
| CRIT | `5GB` | different | `{{ ([pg_size_twentieth, 200])\|min }}GB` |
| TINY | `5GB` | different | `{{ ([pg_size_twentieth, 200])\|min }}GB` |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG9.5–19 Beta 3 = 5GB (dcs); OLAP: PG9.5–19 Beta 3 = 5GB (dcs); CRIT: PG9.5–19 Beta 3 = 5GB (dcs); TINY: PG9.5–19 Beta 3 = 5GB (dcs). Advice, pending human review — Editorial interpretation, pending human maintainer review: the override appears intended to retain a reusable WAL pool large enough to absorb routine bursts without file churn; confirm it against the current Pigsty templates, hardware fixture, and operational guarantees before publication.

## Common pitfalls {#common-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.

## Related parameters {#related-parameters}

[`max_wal_size`](/parameters/max-wal-size/) · [`wal_keep_size`](/parameters/wal-keep-size/) · [`wal_segment_size`](/parameters/wal-segment-size/) · [`checkpoint_timeout`](/parameters/checkpoint-timeout/) · [`checkpoint_completion_target`](/parameters/checkpoint-completion-target/) · [`checkpoint_flush_after`](/parameters/checkpoint-flush-after/)

## References {#references}

- [PostgreSQL 19 Beta 3 — min_wal_size](https://www.postgresql.org/docs/19/runtime-config-wal.html#GUC-MIN-WAL-SIZE)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
