Change default value of default_toast_compression to "lz4", when available
Michael Paquier <michael@paquier.xyz>
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 <euler@eulerto.com> Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Reviewed-by: Aleksander Alekseev <aleksander@tigerdata.com> Discussion: https://posgr.es/m/435df33a-129e-4f0c-a803-f3935c5a5ecb@eisentraut.org
Files
| Path | Change | +/− |
|---|---|---|
| .cirrus.tasks.yml | modified | +1 −0 |
| configure | modified | +4 −2 |
| configure.ac | modified | +1 −1 |
| doc/src/sgml/config.sgml | modified | +6 −7 |
| doc/src/sgml/installation.sgml | modified | +12 −9 |
| doc/src/sgml/ref/alter_table.sgml | modified | +1 −3 |
| doc/src/sgml/ref/create_table.sgml | modified | +1 −3 |
| doc/src/sgml/ref/pg_receivewal.sgml | modified | +1 −3 |
| src/backend/access/common/toast_compression.c | modified | +1 −1 |
| src/backend/utils/misc/guc_parameters.dat | modified | +1 −1 |
| src/backend/utils/misc/postgresql.conf.sample | modified | +1 −1 |
| src/bin/initdb/initdb.c | modified | +5 −0 |
| src/include/access/toast_compression.h | modified | +9 −0 |