Re: WAL compression setting after PostgreSQL LZ4 default change

From: Hannu Krosing <hannuk(at)google(dot)com>
To: Tomas Vondra <tomas(at)vondra(dot)me>
Cc: Andreas Karlsson <andreas(at)proxel(dot)se>, Christoph Berg <myon(at)debian(dot)org>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, 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-08-04 07:03:47
Message-ID: CAMT0RQT2JKFmiEnVUzGex2nmgvoYCegVD_+71e17o1p0fyHx8Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 3, 2026 at 10:36 PM Tomas Vondra <tomas(at)vondra(dot)me> wrote:
>
> On 8/3/26 15:36, Hannu Krosing wrote:
> > For the CPU usage vs compression ratio discussion, please remember
> > that for both lz4 and zstd this depends on certain "compression
> > effort" flags, which we do not expose to customers (we claim we
> > already choose the best ones for them :) )
> >
>
> I'm not sure we really make such claims.

Yeah, I re-checked and all the claims I remembered were from mailing
list discussions, not official docs.

> AFAIK we simply use the default
> compression levels, specified by the lz4/zstd library, and assume the
> authors picked the right trade offs. I think that's sensible.

It's a bit more complicated than that - we use zstd level 1 while the
default for the zstd command-line utility is level 3

We should keep this in mind when running any manual compression tests.

My recollection from running some manual tests a year or two ago is
that on compression side there was a fair bit of overlap in speed
between lz4 and zstd when looking across many compression levels.

However, lz4 was a clear winner in decompression speeds, being 2-3
times faster than zstd.

----
Hannu Krosing

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Xuneng Zhou 2026-08-04 07:16:36 Re: Add a pg_wal_preallocate() SQL function to eagerly create future WAL segments
Previous Message Nazir Bilal Yavuz 2026-08-04 07:02:45 Re: Add a pg_wal_preallocate() SQL function to eagerly create future WAL segments