Re: WAL compression setting after PostgreSQL LZ4 default change

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Christoph Berg <myon(at)debian(dot)org>
Cc: Tomas Vondra <tomas(at)vondra(dot)me>, wenhui qiu <qiuwenhuifx(at)gmail(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Andres Freund <andres(at)anarazel(dot)de>, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, Michael Paquier <michael(at)paquier(dot)xyz>, Japin Li <japinli(at)hotmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, John Naylor <johncnaylorls(at)gmail(dot)com>
Subject: Re: WAL compression setting after PostgreSQL LZ4 default change
Date: 2026-07-31 14:58:32
Message-ID: 856ABCB3-1D3A-4E1D-B694-C258E95CA1AC@yandex-team.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 31 Jul 2026, at 18:10, Christoph Berg <myon(at)debian(dot)org> wrote:
>
> zstd for WAL

FWIW on 19beta2, one client: a seqscan setting hint bits on a freshly
checkpointed 380MB table with wal_log_hints on, so ~47k full-page images
and little else. Best of three: off 765ms, pglz 1402ms, lz4 444ms, zstd
797ms, writing 382/105/107/67 MB of WAL (fsync off, so the I/O saving is
understated). lz4 is the only setting faster than no compression at all,
while pglz costs nearly double for the size lz4 gives away for free. zstd
compresses a third better but pays for it in CPU, partly by allocating a
ZSTD_CCtx per FPI - see the nearby thread "Compression of bigger WAL
records". +1 for "on" meaning lz4 where available.

Best regards, Andrey Borodin.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2026-07-31 15:01:33 Re: bump minimum supported version of psql and pg_{dump,dumpall,upgrade} to v10
Previous Message Vladlen Popolitov 2026-07-31 14:55:04 Re: zic: fix PostgreSQL build failure on filesystems without hard link support