agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Change wal_compression=on to the first of zstd, lz4, pglz
Date: Tue, 11 Aug 2026 23:28:55 +0000
Message-ID: <E1wtvtu-00000000Aw8-2kzS@gemulon.postgresql.org> (raw)
Change wal_compression=on to the first of zstd, lz4, pglz
Previously, wal_compression=on was an alias for pglz, with the
assumption that users could make an informed choice to pick a better
option. But in practice, users rarely got to that second step.
Many users don't want to be choosing algorithms - they just want WAL
compression, and expect that to work well. The configuration parameter
is set by administrators, who do not control the workload, and so are
not in a position to evaluate the options anyway. Some users may not
even realize there are other options, as previously "on" was the only
choice available.
This change maps "on" to non-pglz options, supported by the build. Both
lz4 and zstd are faster, with a comparable (or better) compression
ratio. We prefer zstd over lz4 - per our testing the better compression
ratio pays for the lower (de)compression speed.
Like for TOAST compression, the value depends on algorithms supported by
the PostgreSQL build, with lz4 and zstd being optional. But most builds
will have at least one of these external libraries. If neither zstd or
lz4 is supported, we fallback to pglz.
This only affects what "on" means. Users can still make the informed
choice and explicitly select a compression algorithm if it works better
for their system. The default value for "wal_compression" remains "off."
Initial proposal and patch by wenhui qiu, reviews and patch adjustments
by Christoph Berg. A number of other people participated in the
discussion. Benchmarks by me.
Backpatch to 19.
Author: wenhui qiu <qiuwenhuifx@gmail.com>
Reviewed-by: Christoph Berg <myon@debian.org>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CAGjGUAL1b=Mwd1SCvLbo+fivEr9KDpFcu4jmqKCZXwT=6CiiGQ@mail.gmail.com
Backpatch-through: 19
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/5838806ce696dd0759c5e4b87754e802612135e0
Modified Files
--------------
doc/src/sgml/config.sgml | 12 ++++++------
src/backend/utils/misc/guc_tables.c | 8 ++++----
src/backend/utils/misc/postgresql.conf.sample | 3 ++-
src/include/access/xlog.h | 13 +++++++++++++
4 files changed, 25 insertions(+), 11 deletions(-)
view thread (7+ messages) latest in thread
Message-ID: <E1wtvtu-00000000Aw8-2kzS@gemulon.postgresql.org>
Permalink: ../E1wtvtu-00000000Aw8-2kzS@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1wtvtu-00000000Aw8-2kzS@gemulon.postgresql.org
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: pgsql-committers@postgresql.org
Cc: tomas.vondra@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Change wal_compression=on to the first of zstd, lz4, pglz
In-Reply-To: <E1wtvtu-00000000Aw8-2kzS@gemulon.postgresql.org>
* 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