Change default value of default_toast_compression to "lz4", when available
The default value for default_toast_compression was "pglz". The main reason for this choice is that this option is always available, pglz code being embedded in Postgres. However, it is known that LZ4 is more efficient than pglz: less CPU required, more compression on average. As of this commit, the default value of default_toast_compression becomes "lz4", if available. By switching to LZ4 as the default, users should see natural speedups on TOAST data reads and/or writes. Support for LZ4 in TOAST compression was added in Postgres v14, or 5 releases ago. This should be long enough to consider this feature as stable. --with-lz4 is removed, replaced by a --without-lz4 to disable LZ4 in the builds on an option-basis, following a practice similar to readline or ICU. References to --with-lz4 are removed from the documentation. While at it, quotes are removed from default_toast_compression in postgresql.conf.sample. Quotes are not required in this case. The in-place value replacement done by initdb if the build supports LZ4 would not use them in the postgresql.conf file added to a freshly-initialized cluster. For the reference, a similar switch has been done with ICU in fcb21b3acdcb. Some of the changes done in this commit are consistent with that. Note: this is going to create some disturbance in the buildfarm, in environments where lz4 is not installed. Author: Euler Taveira <[email protected]> Reviewed-by: Peter Eisentraut <[email protected]> Reviewed-by: Aleksander Alekseev <[email protected]> Discussion: https://posgr.es/m/[email protected] Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/7c1849311e49ec57cb86b32a9aa630456588c3f0 Modified Files -------------- .cirrus.tasks.yml | 1 + configure | 6 ++++-- configure.ac | 2 +- doc/src/sgml/config.sgml | 13 ++++++------- doc/src/sgml/installation.sgml | 21 ++++++++++++--------- doc/src/sgml/ref/alter_table.sgml | 4 +--- doc/src/sgml/ref/create_table.sgml | 4 +--- doc/src/sgml/ref/pg_receivewal.sgml | 4 +--- src/backend/access/common/toast_compression.c | 2 +- src/backend/utils/misc/guc_parameters.dat | 2 +- src/backend/utils/misc/postgresql.conf.sample | 2 +- src/bin/initdb/initdb.c | 5 +++++ src/include/access/toast_compression.h | 9 +++++++++ 13 files changed, 44 insertions(+), 31 deletions(-)
