Re: Compress ReorderBuffer spill files using LZ4
Julien Tachoires <julmon@gmail.com>
From: Julien Tachoires <julmon@gmail.com>
To: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2024-07-15T18:50:56Z
Lists: pgsql-hackers
Attachments
- v2-0004-Compress-ReorderBuffer-spill-files-using-PGLZ.patch (application/octet-stream) patch v2-0004
- v2-0001-Compress-ReorderBuffer-spill-files-using-LZ4.patch (application/octet-stream) patch v2-0001
- v2-0002-Add-GUC-logical_decoding_spill_compression.patch (application/octet-stream) patch v2-0002
- v2-0005-Compress-ReorderBuffer-spill-files-using-ZSTD.patch (application/octet-stream) patch v2-0005
- v2-0003-Fix-spill_bytes-counter.patch (application/octet-stream) patch v2-0003
- v2-0007-WIP-Add-the-subscription-option-spill_compression.patch (application/octet-stream) patch v2-0007
- v2-0006-Add-ReorderBuffer-ondisk-compression-tests.patch (application/octet-stream) patch v2-0006
Hi, Le ven. 7 juin 2024 à 06:18, Julien Tachoires <julmon@gmail.com> a écrit : > > Le ven. 7 juin 2024 à 05:59, Tomas Vondra > <tomas.vondra@enterprisedb.com> a écrit : > > > > On 6/6/24 12:58, Julien Tachoires wrote: > > > ... > > > > > > When compiled with LZ4 support (--with-lz4), this patch enables data > > > compression/decompression of these temporary files. Each transaction > > > change that must be written on disk (ReorderBufferDiskChange) is now > > > compressed and encapsulated in a new structure. > > > > > > > I'm a bit confused, but why tie this to having lz4? Why shouldn't this > > be supported even for pglz, or whatever algorithms we add in the future? > > That's right, reworking this patch in that sense. Please find a new version of this patch adding support for LZ4, pglz and ZSTD. It introduces the new GUC logical_decoding_spill_compression which is used to set the compression method. In order to stay aligned with the other server side GUCs related to compression methods (wal_compression, default_toast_compression), the compression level is not exposed to users. The last patch of this set is still in WIP, it adds the machinery required for setting the compression methods as a subscription option: CREATE SUBSCRIPTION ... WITH (spill_compression = ...); I think there is a major problem with this approach: the logical decoding context is tied to one replication slot, but multiple subscriptions can use the same replication slot. How should this work if 2 subscriptions want to use the same replication slot but different compression methods? At this point, compression is only available for the changes spilled on disk. It is still not clear to me if the compression of data transiting through the streaming protocol should be addressed by this patch set or by another one. Thought ? Regards, JT
Commits
-
Change the default value of the streaming option to 'parallel'.
- 1bf1140be872 18.0 cited