agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Change wal_compression=on to the first of zstd, lz4, pglz
7+ messages / 3 participants
[nested] [flat]

* pgsql: Change wal_compression=on to the first of zstd, lz4, pglz
@ 2026-08-11 23:28  Tomas Vondra <tomas.vondra@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Tomas Vondra @ 2026-08-11 23:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/931c9701f2509160a2bed7d50129669e2cb32bf9

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(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Change wal_compression=on to the first of zstd, lz4, pglz
@ 2026-08-11 23:28  Tomas Vondra <tomas.vondra@postgresql.org>
  0 siblings, 1 reply; 7+ messages in thread

From: Tomas Vondra @ 2026-08-11 23:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pgsql: Change wal_compression=on to the first of zstd, lz4, pglz
@ 2026-08-11 23:52  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Tomas Vondra <tomas.vondra@postgresql.org>
  0 siblings, 1 reply; 7+ messages in thread

From: Tom Lane @ 2026-08-11 23:52 UTC (permalink / raw)
  To: Tomas Vondra <tomas.vondra@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org

Tomas Vondra <tomas.vondra@postgresql.org> writes:
> 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.

[ raised eyebrow... ]  I don't object to this change in master,
but it seems pretty out of scope for v19 at this point.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pgsql: Change wal_compression=on to the first of zstd, lz4, pglz
@ 2026-08-12 15:46  Tomas Vondra <tomas@vondra.me>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 7+ messages in thread

From: Tomas Vondra @ 2026-08-12 15:46 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; Tomas Vondra <tomas.vondra@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org

On 8/12/26 01:52, Tom Lane wrote:
> Tomas Vondra <tomas.vondra@postgresql.org> writes:
>> 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.
> 
> [ raised eyebrow... ]  I don't object to this change in master,
> but it seems pretty out of scope for v19 at this point.
> 

Yeah. The consensus in the discussion thread was it'd be good to do this
in 19, together with the TOAST compression default. I wasn't sure about
that, so I consulted with the RMT and the response was it's OK.

If that's not sufficient, and it's too late for 19, we can revert it.


regards

-- 
Tomas Vondra






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pgsql: Change wal_compression=on to the first of zstd, lz4, pglz
@ 2026-08-12 15:55  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Tomas Vondra <tomas@vondra.me>
  0 siblings, 1 reply; 7+ messages in thread

From: Tom Lane @ 2026-08-12 15:55 UTC (permalink / raw)
  To: Tomas Vondra <tomas@vondra.me>; +Cc: pgsql-committers@lists.postgresql.org

Tomas Vondra <tomas@vondra.me> writes:
> On 8/12/26 01:52, Tom Lane wrote:
>> [ raised eyebrow... ]  I don't object to this change in master,
>> but it seems pretty out of scope for v19 at this point.

> Yeah. The consensus in the discussion thread was it'd be good to do this
> in 19, together with the TOAST compression default. I wasn't sure about
> that, so I consulted with the RMT and the response was it's OK.

Ah.  The point about changing this along with the TOAST compression
default does make sense.  Objection withdrawn ... but this needs
to get into the v19 release notes beside the other change.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pgsql: Change wal_compression=on to the first of zstd, lz4, pglz
@ 2026-08-12 18:28  Tomas Vondra <tomas@vondra.me>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 7+ messages in thread

From: Tomas Vondra @ 2026-08-12 18:28 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org



On 8/12/26 17:55, Tom Lane wrote:
> Tomas Vondra <tomas@vondra.me> writes:
>> On 8/12/26 01:52, Tom Lane wrote:
>>> [ raised eyebrow... ]  I don't object to this change in master,
>>> but it seems pretty out of scope for v19 at this point.
> 
>> Yeah. The consensus in the discussion thread was it'd be good to do this
>> in 19, together with the TOAST compression default. I wasn't sure about
>> that, so I consulted with the RMT and the response was it's OK.
> 
> Ah.  The point about changing this along with the TOAST compression
> default does make sense.  Objection withdrawn ... but this needs
> to get into the v19 release notes beside the other change.
> 

Right. Naive question - what's the proper process to make that happen
for changes like this? Ping someone / RMT?

regards

-- 
Tomas Vondra






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pgsql: Change wal_compression=on to the first of zstd, lz4, pglz
@ 2026-08-12 18:32  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Tomas Vondra <tomas@vondra.me>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2026-08-12 18:32 UTC (permalink / raw)
  To: Tomas Vondra <tomas@vondra.me>; +Cc: pgsql-committers@lists.postgresql.org

Tomas Vondra <tomas@vondra.me> writes:
> On 8/12/26 17:55, Tom Lane wrote:
>> Ah.  The point about changing this along with the TOAST compression
>> default does make sense.  Objection withdrawn ... but this needs
>> to get into the v19 release notes beside the other change.

> Right. Naive question - what's the proper process to make that happen
> for changes like this? Ping someone / RMT?

You've got a commit bit, go fix doc/src/sgml/release-19.sgml yourself.
Or pester Bruce if you'd rather he did it, but it's simple enough.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2026-08-12 18:32 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-08-11 23:28 pgsql: Change wal_compression=on to the first of zstd, lz4, pglz Tomas Vondra <tomas.vondra@postgresql.org>
2026-08-11 23:28 pgsql: Change wal_compression=on to the first of zstd, lz4, pglz Tomas Vondra <tomas.vondra@postgresql.org>
2026-08-11 23:52 ` Tom Lane <tgl@sss.pgh.pa.us>
2026-08-12 15:46   ` Tomas Vondra <tomas@vondra.me>
2026-08-12 15:55     ` Tom Lane <tgl@sss.pgh.pa.us>
2026-08-12 18:28       ` Tomas Vondra <tomas@vondra.me>
2026-08-12 18:32         ` Tom Lane <tgl@sss.pgh.pa.us>

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