public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: wenhui qiu <[email protected]>
Cc: pgsql-hackers <[email protected]>
Cc: Japin Li <[email protected]>
Cc: John Naylor <[email protected]>
Cc: Christoph Berg <[email protected]>
Subject: Re: WAL compression setting after PostgreSQL LZ4 default change
Date: Wed, 1 Jul 2026 08:45:17 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAGjGUAL1b=Mwd1SCvLbo+fivEr9KDpFcu4jmqKCZXwT=6CiiGQ@mail.gmail.com>
References: <CAGjGUAL1b=Mwd1SCvLbo+fivEr9KDpFcu4jmqKCZXwT=6CiiGQ@mail.gmail.com>

On Tue, Jun 30, 2026 at 06:25:09PM +0800, wenhui qiu wrote:
> The recent PostgreSQL commit changes the default TOAST compression to lz4
> when LZ4 support is available, based on the rationale that LZ4 is generally
> more efficient than pglz in terms of CPU usage and compression
> ratio.  Given that, should we also consider changing the default
> compression method used by wal_compression = on from pglz to lz4?

"on" is just a backward-compatible value, so we could let it as-is.

> Currently, wal_compression = on still maps to pglz, while lz4 has to be
> selected explicitly with:
> 
> wal_compression = lz4
> If LZ4 is now considered stable and preferable enough to become the default
> for TOAST compression, it may be worth aligning WAL compression behavior as
> well, or at least discussing whether on should continue to imply pglz.

If I were switch the default, for me zstd goes first, lz4 is a close
second, and pglz is the last of its class.  The only reason why we
have not chosen zstd for TOAST is the fact that we don't support it
(trickier to add support for it as we have to preserve on-disk 
compatibility for inline compressed TOAST entries).

In short, lz4 is available in many environments, but I'm also ready to
bet that zstd is equally available in these environments.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../[email protected]/2-signature.asc)
  download

view thread (12+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: WAL compression setting after PostgreSQL LZ4 default change
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox