Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> The only thing I've been able to think of that seems like it might
>> improve matters is to make the WAL writing logic aware of the layout
>> of buffer pages --- specifically, to know that our pages generally
>> contain an uninteresting "hole" in the middle, and not write the hole.
>> Optimistically this might reduce the WAL data volume by something
>> approaching 50%; though pessimistically (if most pages are near full)
>> it wouldn't help much.
> Good idea. How about putting the page through or TOAST compression
> routine before writing it to WAL? Should be pretty easy and fast and
> doesn't require any knowledge of the page format.
Easy, maybe, but fast definitely NOT. The compressor is not speedy.
Given that we have to be holding various locks while we build WAL
records, I do not think it's a good idea to add CPU time there.
Also, compressing already-compressed data is not a win ...
regards, tom lane