summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2022-03-11 12:18:53 +0900
committerMichael Paquier <michael@paquier.xyz>2022-03-11 12:18:53 +0900
commite9537321a74a2b062c8f7a452314b4570913f780 (patch)
treecc8f59efc8009d2a26c7028c6ef6369a9846504f /doc/src
parent0071fc71277e51723eeb4856eeeb5d25600a429a (diff)
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
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/config.sgml11
-rw-r--r--doc/src/sgml/installation.sgml8
2 files changed, 15 insertions, 4 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 7ed8c82a9dd..5612e804533 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3154,10 +3154,13 @@ include_dir 'conf.d'
server compresses full page images written to WAL when
<xref linkend="guc-full-page-writes"/> is on or during a base backup.
A compressed page image will be decompressed during WAL replay.
- The supported methods are <literal>pglz</literal> and
- <literal>lz4</literal> (if <productname>PostgreSQL</productname> was
- compiled with <option>--with-lz4</option>). The default value is
- <literal>off</literal>. Only superusers can change this setting.
+ The supported methods are <literal>pglz</literal>,
+ <literal>lz4</literal> (if <productname>PostgreSQL</productname>
+ was compiled with <option>--with-lz4</option>) and
+ <literal>zstd</literal> (if <productname>PostgreSQL</productname>
+ was compiled with <option>--with-zstd</option>) and
+ The default value is <literal>off</literal>.
+ Only superusers can change this setting.
</para>
<para>
diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
index 0f742525908..a239bbef2f5 100644
--- a/doc/src/sgml/installation.sgml
+++ b/doc/src/sgml/installation.sgml
@@ -273,6 +273,14 @@ su - postgres
<listitem>
<para>
+ You need <productname>zstd</productname>, if you want to support
+ compression of data with this method; see
+ <xref linkend="guc-wal-compression"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
To build the <productname>PostgreSQL</productname> documentation,
there is a separate set of requirements; see
<xref linkend="docguide-toolsets"/>.