Re: [REVIEW] Re: Compression of full-page-writes

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Rahila Syed <rahilasyed(dot)90(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [REVIEW] Re: Compression of full-page-writes
Date: 2014-12-04 11:37:57
Message-ID: CAB7nPqQ0=x2tpTHgoPUE9V9+FfKwwc5GVZ74bjLAAv=F233fhA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 4, 2014 at 7:36 PM, Rahila Syed <rahilasyed(dot)90(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2014-12-04 11:47:33 Re: [COMMITTERS] pgsql: Keep track of transaction commit timestamps
Previous Message Heikki Linnakangas 2014-12-04 11:26:07 Re: [COMMITTERS] pgsql: Keep track of transaction commit timestamps