Re: A few new options for CHECKPOINT

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Bernd Helmle <mailings(at)oopsware(dot)de>, Michael Paquier <michael(at)paquier(dot)xyz>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: A few new options for CHECKPOINT
Date: 2020-11-28 21:28:52
Message-ID: 03B3EAA2-29F7-48CD-BB71-281A36A02116@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/28/20, 9:50 AM, "Stephen Frost" <sfrost(at)snowman(dot)net> wrote:
>> Granted, I used a rather aggressive checkpoint_timeout, but I think
>> this demonstrates that waiting for a non-immediate checkpoint to
>> complete can lower the amount of WAL needed for recovery, even though
>> it might not lower it as much as waiting for an immediate checkpoint
>> would.
>
> The difference here feels like order of magnitudes to me, between an
> immediate checkpoint and a non-immediate one, vs. a much smaller
> difference as you've shown here (though, still, kill'ing the postmaster
> isn't exactly the same as what your patch would be doing, so I don't
> really like using this particular analysis to answer this question...).

I agree that using an immediate checkpoint is the best for reducing
recovery time. IMO reducing the amount of WAL to recover by up to 50%
from doing no checkpoint at all is also a reasonable use case,
especially if avoiding an IO spike is important.

> If the use-case here was just that you wanted to add more options to the
> CHECKPOINT command because we have them internally and maybe they'd be
> useful to expose then these things probably wouldn't matter so much, but
> to imply that this is really going to cut down on the amount of WAL
> replay required a lot isn't really coming through even with these
> results.

This is how I initially presented this patch. I only included this
use case because I was asked for concrete examples of how it might be
useful.

Nathan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Seltenreich 2020-11-28 21:43:06 [sqlsmith] Failed assertion during partition pruning
Previous Message Pavel Stehule 2020-11-28 21:14:38 Re: proposal: possibility to read dumped table's name from file