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 11:15:30
Message-ID: CAMT0RQQaj6wjpGwjYkFYL+iAHxhcNAZGstvGXqkocUwRPE-HCA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 4, 2026 at 12:01 PM Tomas Vondra <tomas(at)vondra(dot)me> wrote:
>
> On 8/4/26 09:03, Hannu Krosing wrote:
> > On Mon, Aug 3, 2026 at 10:36 PM Tomas Vondra <tomas(at)vondra(dot)me> wrote:
...

> > 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.
> >
>
> Are you sure? Because I see xloginsert.c does this:
>
> len = ZSTD_compress(dest, COMPRESS_BUFSIZE, source, orig_len,
> ZSTD_CLEVEL_DEFAULT);
>
> and ZSTD_CLEVEL_DEFAULT (=3) is the constant from zstd library. So at
> least for WAL we should be using the "normal" compression level.

Yes, you are right.

I was confused by development-time list discussions which mostly
talked about using level=1, even though the default was 3 (or even 6)

---
Hannu

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Vitaly Davydov 2026-08-04 11:16:24 Re: Deadlock detector fails to activate on a hot standby replica
Previous Message Zhijie Hou (Fujitsu) 2026-08-04 10:56:37 RE: [PATCH] Release replication slot on error in SQL-callable slot functions