Re: [REVIEW] Re: Compression of full-page-writes - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [REVIEW] Re: Compression of full-page-writes
Date
Msg-id CAB7nPqQ0=x2tpTHgoPUE9V9+FfKwwc5GVZ74bjLAAv=F233fhA@mail.gmail.com
Whole thread Raw
In response to Re: [REVIEW] Re: Compression of full-page-writes  (Rahila Syed <rahilasyed.90@gmail.com>)
Responses Re: [REVIEW] Re: Compression of full-page-writes  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On Thu, Dec 4, 2014 at 7:36 PM, Rahila Syed <rahilasyed.90@gmail.com> wrote:
> IIUC, forcibly written fpws are not exposed to user , so is it worthwhile to
> add a GUC similar to full_page_writes in order to control a feature which is
> unexposed to user in first place?
>
> If full page writes is set 'off' by user, user probably cannot afford the
> overhead involved in writing large pages to disk . So , if a full page write
> is forcibly written in such a situation it is better to compress it before
> writing to alleviate the drawbacks of writing full_page_writes in servers
> with heavy write load.
>
> The only scenario in which a user would not want to compress forcibly
> written pages is when CPU utilization is high. But according to measurements
> done earlier the CPU utilization  of compress='on' and 'off' are not
> significantly different.

Yes they are not visible to the user still they exist. I'd prefer that we have
a safety net though to prevent any problems that may occur if compression
algorithm has a bug as if we enforce compression for forcibly-written blocks
all the backups of our users would be impacted.

I pondered something that Andres mentioned upthread: we may not do the
compression in WAL record only for blocks, but also at record level. Hence
joining the two ideas together I think that we should definitely have
a different
GUC to control the feature, consistently for all the images. Let's call it
wal_compression, with the following possible values:
- on, meaning that a maximum of compression is done, for this feature
basically full_page_writes = on.
- full_page_writes, meaning that full page writes are compressed
- off, default value, to disable completely the feature.
This would let room for another mode: 'record', to completely compress
a record. For now though, I think that a simple on/off switch would be
fine for this patch. Let's keep things simple.
Regards,
-- 
Michael



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: [COMMITTERS] pgsql: Keep track of transaction commit timestamps
Next
From: Petr Jelinek
Date:
Subject: Re: [COMMITTERS] pgsql: Keep track of transaction commit timestamps