wal-compression · shipping · also wal_compression, PostgreSQL WAL image compression

WAL compression

PostgreSQL WAL compression optionally compresses full-page images within its write-ahead log.

The setting targets page images, not all WAL records or archived segment files. PostgreSQL 18 supports pglz, plus lz4 and zstd when compiled with the corresponding libraries. Replay decompresses the images. [1]

The REL_18_0 builder can omit an unused page hole and uses compression only when the encoded representation saves space. An image count is therefore not a byte count. [2]

Relations

related
Full-page write, Write-ahead log, Database checkpoint

Limitations

  • Compression and decompression consume CPU during logging and replay. [1]

Citations

  1. PostgreSQL 18: WAL settings, hint logging and image compression (accessed 2026-10-16)
  2. PostgreSQL REL_18_0: xloginsert.c, page holes and XLogCompressBackupBlock (accessed 2026-10-16)

Further reading

  1. Hesela: WAL page images, hint-bit changes and measurement boundaries (accessed 2026-10-16)
Sources & caveats
  • Scoped to PostgreSQL 18 documentation and REL_18_0 code; no measured compression ratio or performance improvement is claimed.

JSON: /data/terms/wal-compression.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. WAL compression. Hesela. 2026-10-16. https://hesela.dev/terms/wal-compression/