postgresql/src/backend
Michael Paquier e9537321a7 Add support for zstd with compression of full-page writes in WAL
wal_compression gains a new value, "zstd", to allow the compression of
full-page images using the compression method of the same name.

Compression is done using the default level recommended by the library,
as of ZSTD_CLEVEL_DEFAULT = 3.  Some benchmarking has shown that it
could make sense to use a level lower for the FPI compression, like 1 or
2, as the compression rate did not change much with a bit less CPU
consumed, but any tests done would only cover few scenarios so it is
hard to come to a clear conclusion.  Anyway, there is no reason to not
use the default level instead, which is the level recommended by the
library so it should be fine for most cases.

zstd outclasses easily pglz, and is better than LZ4 where one wants to
have more compression at the cost of extra CPU but both are good enough
in their own scenarios, so the choice between one or the other of these
comes to a study of the workload patterns and the schema involved,
mainly.

This commit relies heavily on 4035cd5, that reshaped the code creating
and restoring full-page writes to be aware of the compression type,
making this integration straight-forward.

This patch borrows some early work from Andrey Borodin, though the patch
got a complete rewrite.

Author: Justin Pryzby
Discussion: https://postgr.es/m/20220222231948.GJ9008@telsasoft.com
2022-03-11 12:18:53 +09:00
..
access Add support for zstd with compression of full-page writes in WAL 2022-03-11 12:18:53 +09:00
bootstrap pg_upgrade: Preserve relfilenodes and tablespace OIDs. 2022-01-17 13:40:27 -05:00
catalog Parse/analyze function renaming 2022-03-04 14:50:22 +01:00
commands Add pg_analyze_and_rewrite_varparams() 2022-03-07 08:13:30 +01:00
executor Improve comment in execReplication.c 2022-03-08 14:29:03 +09:00
foreign Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
jit Track LLVM 15 changes. 2022-02-14 15:51:43 +13:00
lib dshash: Add sequential scan support. 2022-03-10 12:57:05 -08:00
libpq Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
main windows: Improve crash / assert / exception handling. 2022-02-02 18:33:25 -08:00
nodes Allow specifying row filters for logical replication of tables. 2022-02-22 08:11:50 +05:30
optimizer Parse/analyze function renaming 2022-03-04 14:50:22 +01:00
parser Add parse_analyze_withcb() 2022-03-09 11:08:16 +01:00
partitioning Fix misuse of "const" qualifier. 2022-02-13 19:20:56 -05:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Ensure that the argument of shmdt(2) is declared "void *". 2022-02-15 17:17:28 -05:00
postmaster Reconsider pg_stat_subscription_workers view. 2022-03-01 06:17:52 +05:30
regex Call pg_newlocale_from_collation() also with default collation 2022-01-20 09:50:18 +01:00
replication Fix LZ4 tests for remaining buffer space. 2022-03-08 10:05:55 -05:00
rewrite Update copyright for 2022 2022-01-07 19:04:57 -05:00
snowball Update copyright for 2022 2022-01-07 19:04:57 -05:00
statistics Fix various typos, grammar and code style in comments and docs 2022-01-25 09:40:04 +09:00
storage Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
tcop Add parse_analyze_withcb() 2022-03-09 11:08:16 +01:00
tsearch Update copyright for 2022 2022-01-07 19:04:57 -05:00
utils Add support for zstd with compression of full-page writes in WAL 2022-03-11 12:18:53 +09:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Server-side gzip compression. 2022-01-24 15:13:18 -05:00
nls.mk Report progress of startup operations that take a long time. 2021-10-25 11:51:57 -04:00