暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

PostgreSQL 15 preview - Add support for zstd with compression of full-page writes in WAL

原创 digoal 2022-01-20
671

作者

digoal

日期

2022-03-11

标签

PostgreSQL , zstd , wal , full page write , compress


Add support for zstd with compression of full-page writes in WAL

#wal_compression = off         # enables compression of full-page writes;  
+                   # off, pglz, lz4, zstd, or on    
复制

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=e9537321a74a2b062c8f7a452314b4570913f780

Add support for zstd with compression of full-page writes in WAL master github/master  
author  Michael Paquier <michael@paquier.xyz>     
Fri, 11 Mar 2022 03:18:53 +0000 (12:18 +0900)  
committer   Michael Paquier <michael@paquier.xyz>     
Fri, 11 Mar 2022 03:18:53 +0000 (12:18 +0900)  
commit  e9537321a74a2b062c8f7a452314b4570913f780  
tree    cc8f59efc8009d2a26c7028c6ef6369a9846504f    tree  
parent  0071fc71277e51723eeb4856eeeb5d25600a429a    commit | 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  
复制

期望 PostgreSQL 增加什么功能?

PolarDB for PostgreSQL云原生分布式开源数据库

PostgreSQL 解决方案集合

德哥 / digoal's github - 公益是一辈子的事.

digoal's wechat

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论