> On 12 Jan 2025, at 17:43, Andrey M. Borodin <x4...@yandex-team.ru> wrote: > > I attach a prototype patch.
Here's v2, now it passes all the tests with wal_debug. Some stats. On this test create table a as select random() from generate_series(1,1e7); select pg_stat_reset_shared('wal'); create index on a(random ); select pg_size_pretty(wal_bytes) from pg_stat_wal; set wal_compression to 'lz4'; select pg_stat_reset_shared('wal'); create index on a(random ); select pg_size_pretty(wal_bytes) from pg_stat_wal; set wal_compression to 'pglz'; select pg_stat_reset_shared('wal'); create index on a(random ); select pg_size_pretty(wal_bytes) from pg_stat_wal; set wal_compression to 'zstd'; select pg_stat_reset_shared('wal'); create index on a(random ); select pg_size_pretty(wal_bytes) from pg_stat_wal; I observe WAL size of the index: method HEAD patched pglz 193 MB 193 MB lz4 160 MB 132 MB zstd 125 MB 97 MB So, for lz4 and zstd this seems to be a significant reduction. I'm planning to work on improving the patch quality. Thanks! Best regards, Andrey Borodin.
v2-0001-Compress-big-WAL-records.patch
Description: Binary data