Re: change default default_toast_compression to lz4?

From: "Euler Taveira" <euler(at)eulerto(dot)com>
To: "Aleksander Alekseev" <aleksander(at)tigerdata(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: "Michael Paquier" <michael(at)paquier(dot)xyz>, "Peter Eisentraut" <peter(at)eisentraut(dot)org>
Subject: Re: change default default_toast_compression to lz4?
Date: 2025-12-04 20:11:15
Message-ID: c269e7e1-2ef0-4fb2-8ecd-18ab2db13e3b@app.fastmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 27, 2025, at 6:44 AM, Aleksander Alekseev wrote:
> Many thanks for working on this. Unfortunately the patch is
> incomplete. I think we also agreed that lz4 should be opt-out.
>

Aleksander, I missed this point.

Here it is v2. It enforces the lz4 dependency. It works the same as other
dependencies (readline, icu, zlib); error if the dependency could not be found.
Regarding meson, I'm confused. If any of the referred dependencies (icu,
readline, zlib) is not found, there is no hard error. Instead, the feature is
disabled. I searched for a discussion about this decision but couldn't find.
For this patch, I decided to use the same pattern (no error) but I added a
warning message (similar to zlib).

$ meson setup build --prefix=/tmp/pg | grep -i warning
meson.build:1100: WARNING: did not find lz4
meson.build:1675: WARNING: did not find zlib

The other alternative is to always 'enabled' lz4 in meson_options.txt. This
requires you to explicitly enable/disable lz4 if you are using -Dauto_features
option.

Should it report an error (like autoconf) instead of silently disable the
feature that is a requirement? If yes, then we should add error messages for
these 3 dependencies.

$ ./configure --prefix=/tmp/pg
.
.
checking whether to build with ICU support... yes
checking for icu-uc icu-i18n... no
configure: error: Package requirements (icu-uc icu-i18n) were not met:

Package 'icu-uc', required by 'virtual:world', not found
Package 'icu-i18n', required by 'virtual:world', not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables ICU_CFLAGS
and ICU_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

$ git clean -dfxq
$ meson setup build --prefix=/tmp/pg
.
.
Run-time dependency icu-uc found: NO (tried pkgconfig and cmake)
Run-time dependency icu found: NO (tried cmake)
.
.
Run-time dependency readline found: NO (tried pkgconfig and cmake)
Library readline found: NO
.
.
External libraries
bonjour : NO
bsd_auth : NO
docs : NO
docs_pdf : NO
gss : NO
icu : NO
ldap : NO
libcurl : NO
libnuma : NO
liburing : NO
libxml : NO
libxslt : NO
llvm : NO
lz4 : NO
nls : YES
openssl : NO
pam : NO
plperl : NO 5.40.1
plpython : NO
pltcl : NO
readline : NO
selinux : NO
systemd : NO
uuid : NO
zlib : NO
zstd : NO

User defined options
prefix : /tmp/pg

Found ninja-1.12.1 at /usr/bin/ninja

--
Euler Taveira
EDB https://www.enterprisedb.com/

Attachment Content-Type Size
v2-0001-Change-default_toast_compression-to-lz4.patch text/x-patch 5.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2025-12-04 20:58:18 making tid and HOTness of UPDATE available to logical decoding plugins
Previous Message Antonin Houska 2025-12-04 19:15:44 Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements