Re: WAL compression setting after PostgreSQL LZ4 default change

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Christoph Berg <myon(at)debian(dot)org>, Tomas Vondra <tomas(at)vondra(dot)me>, 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>, 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-01 08:42:43
Message-ID: am2xgwQz5umg2QZz@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Aug 01, 2026 at 12:50:45AM +0200, Christoph Berg wrote:
> Re: Tomas Vondra
>> AFAIK the algorithms make different trade offs - zstd tends to compress
>> better, but uses (substantially) more CPU. I think it makes sense to
>> default to lz4, it's clearly better than pglz, with low CPU usage.
>
> Yes, lz4 makes sense to me now. zstd is the "can I tune it harder" pick.

In my experience, users care more about I/O than CPU in this area, and
zstd means less I/O, especially with the rising cost of memory and
disk lately, even if it costs with a bit more CPU to compression more.

Then, let's look at a few things out there:
- At [1], Azure defaults to zstd.
- At [2], AWS/RDS defaults to zstd since v15.
- At [3], Google Cloud is off by default.

Even after all these arguments, I guess it's your call if you wish to
apply this patch and change the default to be different than what I
know are the major players in the market. I just see no lz4. lz4 is
better than pglz for sure. :)

[1]: https://learn.microsoft.com/en-us/azure/postgresql/parameters/parameters-write-ahead-log-settings?pivots=postgresql-18
[2]: https://aws.amazon.com/blogs/database/impactful-features-in-postgresql-15/
[3]: https://docs.cloud.google.com/sql/docs/postgres/flags?hl=en
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chengpeng Yan 2026-08-01 09:38:43 Re: a large LIMIT makes some sorts slower
Previous Message David Rowley 2026-08-01 08:35:06 Reduce memory overheads for storing a Memoize tuple