| From: | Andrey Borodin <x4mmm(at)yandex-team(dot)ru> |
|---|---|
| To: | Michael Paquier <michael(at)paquier(dot)xyz> |
| Cc: | Japin Li <japinli(at)hotmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, wenhui qiu <qiuwenhuifx(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Compression of bigger WAL records |
| Date: | 2026-10-24 17:09:03 |
| Message-ID: | D815DE2E-6EEB-4EF4-8B5F-3374F552D55C@yandex-team.ru |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi Michael, Zsolt!
On 14 Oct 2026, Michael Paquier wrote:
> In short, applied the WAL insert part.
Thank you! Attached is v12: whole-record compression (0001), a separate
pg_walinspect update (0002), and WIP streams (0003).
Context reuse removes per-image setup cost. These patches target
redundancy between images in a record and between successive records.
Zsolt, you are right about incompressible records. 0001 now falls back
unless compression saves space including its header. Streams in 0003
still allow individual records to grow to preserve history for later
records.
Following Nikolay Samokhvalov's off-list review [0], FPI-only settings
no longer allocate the large whole-record workspaces. Those are prepared
outside critical sections only for settings that can use them.
A writer also keeps one stream compressor across lease changes,
resetting it when acquiring a different slot. My earlier
one-compressor-per-writer description was not true of v11.
On the statistics question raised by both Zsolt and Nikolay, pg_waldump
and pg_walinspect now expose physical sizes separately from decoded
sizes. I kept wal_fpi_bytes as image bytes before whole-record
compression and documented that it can exceed physical wal_bytes.
There is no exact way to split a jointly compressed payload into image
and non-image bytes.
0003 is still WIP: reader memory and the cost of rewinding to a stream
reset boundary remain open trade-offs.
Best regards, Andrey Borodin.
[0] https://github.com/NikolayS/postgres/issues/99#issuecomment-6068279914
| Attachment | Content-Type | Size |
|---|---|---|
| v12-0001-Add-whole-record-WAL-compression-alongside-FPI-c.patch | application/octet-stream | 67.0 KB |
| v12-0002-Expose-physical-WAL-record-sizes-in-pg_walinspec.patch | application/octet-stream | 13.4 KB |
| v12-0003-WIP-compress-WAL-records-against-earlier-records.patch | application/octet-stream | 68.9 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David Steele | 2026-10-24 17:14:08 | Re: Return pg_control from pg_backup_stop(). |
| Previous Message | Bharath Rupireddy | 2026-10-24 16:20:14 | Re: Skip prefetch for block references that follow a FPW or WILL_INIT of the same block |