forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite953732
committed
Add support for zstd with compression of full-page writes in WAL
wal_compression gains a new value, "zstd", to allow the compression offull-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 itcould make sense to use a level lower for the FPI compression, like 1 or2, as the compression rate did not change much with a bit less CPUconsumed, but any tests done would only cover few scenarios so it ishard to come to a clear conclusion. Anyway, there is no reason to notuse the default level instead, which is the level recommended by thelibrary so it should be fine for most cases.zstd outclasses easily pglz, and is better than LZ4 where one wants tohave more compression at the cost of extra CPU but both are good enoughin their own scenarios, so the choice between one or the other of thesecomes to a study of the workload patterns and the schema involved,mainly.This commit relies heavily on4035cd5, that reshaped the code creatingand 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 patchgot a complete rewrite.Author: Justin PryzbyDiscussion:https://postgr.es/m/20220222231948.GJ9008@telsasoft.com1 parent0071fc7 commite953732
File tree
9 files changed
+78
-8
lines changed- doc/src/sgml
- src
- backend
- access/transam
- utils/misc
- bin/pg_waldump
- include/access
9 files changed
+78
-8
lines changedLines changed: 7 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3154 | 3154 |
| |
3155 | 3155 |
| |
3156 | 3156 |
| |
3157 |
| - | |
3158 |
| - | |
3159 |
| - | |
3160 |
| - | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
| 3160 | + | |
| 3161 | + | |
| 3162 | + | |
| 3163 | + | |
3161 | 3164 |
| |
3162 | 3165 |
| |
3163 | 3166 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
271 | 271 |
| |
272 | 272 |
| |
273 | 273 |
| |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
274 | 282 |
| |
275 | 283 |
| |
276 | 284 |
| |
|
Lines changed: 31 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
26 | 30 |
| |
27 | 31 |
| |
28 | 32 |
| |
| |||
47 | 51 |
| |
48 | 52 |
| |
49 | 53 |
| |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
50 | 60 |
| |
51 | 61 |
| |
52 |
| - | |
| 62 | + | |
| 63 | + | |
53 | 64 |
| |
54 | 65 |
| |
55 | 66 |
| |
| |||
698 | 709 |
| |
699 | 710 |
| |
700 | 711 |
| |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
701 | 720 |
| |
702 | 721 |
| |
703 | 722 |
| |
| |||
906 | 925 |
| |
907 | 926 |
| |
908 | 927 |
| |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
909 | 939 |
| |
910 | 940 |
| |
911 | 941 |
| |
|
Lines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
| 24 | + | |
| 25 | + | |
| 26 | + | |
24 | 27 |
| |
25 | 28 |
| |
26 | 29 |
| |
| |||
1618 | 1621 |
| |
1619 | 1622 |
| |
1620 | 1623 |
| |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
1621 | 1641 |
| |
1622 | 1642 |
| |
1623 | 1643 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
550 | 550 |
| |
551 | 551 |
| |
552 | 552 |
| |
| 553 | + | |
| 554 | + | |
| 555 | + | |
553 | 556 |
| |
554 | 557 |
| |
555 | 558 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
220 | 220 |
| |
221 | 221 |
| |
222 | 222 |
| |
223 |
| - | |
| 223 | + | |
224 | 224 |
| |
225 | 225 |
| |
226 | 226 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
562 | 562 |
| |
563 | 563 |
| |
564 | 564 |
| |
| 565 | + | |
| 566 | + | |
565 | 567 |
| |
566 | 568 |
| |
567 | 569 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
75 | 75 |
| |
76 | 76 |
| |
77 | 77 |
| |
78 |
| - | |
| 78 | + | |
| 79 | + | |
79 | 80 |
| |
80 | 81 |
| |
81 | 82 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
149 | 149 |
| |
150 | 150 |
| |
151 | 151 |
| |
| 152 | + | |
| 153 | + | |
152 | 154 |
| |
153 |
| - | |
| 155 | + | |
| 156 | + | |
154 | 157 |
| |
155 | 158 |
| |
156 | 159 |
| |
|
0 commit comments
Comments
(0)