Reduce WAL volume with wal_compression
Turning wal_compression on cut the WAL for a full-table update from 82 MB to 68 MB, 17.1% with pglz, 16.1% with lz4. Useful, cheap, and nowhere near the numbers people quote.
Problem
What you're actually looking at
The symptom as it shows up on a real server.
With full_page_writes on, the first write to a page after each checkpoint copies the entire 8 kB page into the WAL. On an update-heavy workload those full-page images dominate the WAL stream, and they compress well. wal_compression compresses only those images, which is why the saving depends entirely on what fraction of your WAL they are.
A full-table update on wal_fpi_probe, 250,000 rows, run three times from an identical starting point with a CHECKPOINT immediately before each run so that every page write emits a full-page image.
Simple terms
To survive a crash mid-write, PostgreSQL copies an entire 8 kB page into the WAL the first time it is touched after each checkpoint. On update-heavy workloads those full-page images make up most of the WAL, and they happen to compress well. Turning on wal_compression squeezes just those images, which is why the saving you get depends entirely on how much of your WAL they were in the first place, not on a headline percentage.
Full runbook for this incident
- The full identify checklist, the exact signals that tell you it's this incident
- Every diagnostic query; lab output is attached only to the steps we actually captured
- The resolution path and the pitfalls that make it worse
- Mitigation steps to stop it recurring, plus a verify-you're-done query
Card required. Cancel before day 7 and you are not charged.
More in this category
Other WAL & replication runbooks
Neighbouring incidents that share the same diagnostic surface.
Connected
How this connects to the rest of the library
A live view of this page's real cross-references, what explains it, what fixes it, what to tune, and where to go next. Every link is an authored relationship, not a guess.
Fixes these errors
Need the full procedure?
Pro runbooks finish the incident path
Free runbooks teach the shape. Pro opens the full step transcript, edge cases, and prevention depth.