Re: CHECKPOINT unlogged data

From: Christoph Berg <myon(at)debian(dot)org>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: CHECKPOINT unlogged data
Date: 2025-07-09 21:21:59
Message-ID: aG7ddyB-ESzJYAYp@msg.df7cb.de
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Re: Nathan Bossart
> Here is what I have staged for commit, which I'm planning to do on Friday.

> diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml
> index 9659f76042c..9be752fc12b 100644
> --- a/doc/src/sgml/ref/pg_basebackup.sgml
> +++ b/doc/src/sgml/ref/pg_basebackup.sgml
> @@ -500,7 +500,7 @@ PostgreSQL documentation
> <term><option>--checkpoint={fast|spread}</option></term>
> <listitem>
> <para>
> - Sets checkpoint mode to fast (immediate) or spread (the default)
> + Sets checkpoint mode to fast or spread (the default)
> (see <xref linkend="backup-lowlevel-base-backup"/>).

This is somewhat hard to parse, perhaps combine the two ()() into one:

Sets checkpoint mode to fast or spread (the default is spread,
see <xref linkend="backup-lowlevel-base-backup"/>).

(patch 4)
> <para>
> - The <command>CHECKPOINT</command> command forces a fast
> + When <literal>MODE</literal> is set to <literal>FAST</literal>, which is the
> + default, the <command>CHECKPOINT</command> command forces a fast
> checkpoint when the command is issued, without waiting for a
> regular checkpoint scheduled by the system (controlled by the settings in
> <xref linkend="runtime-config-wal-checkpoints"/>).

Explaining what the option does when explicitly setting the default is
confusing. We should explain the opposite case instead:

The <command>CHECKPOINT</command> command issues a fast checkpoint
by default where writes run at full speed. When literal>MODE</literal>
is set to <literal>SPREAD</literal>, writes are instead limited
by the settings in <xref linkend="runtime-config-wal-checkpoints"/>.

(patch 5)
> <variablelist>
> + <varlistentry>
> + <term><literal>FLUSH_UNLOGGED</literal></term>
> + <listitem>
> + <para>
> + Normally, <command>CHECKPOINT</command> does not flush data files for
> + unlogged relations. This option, which is disabled by default, enables
> + flushing unlogged relations.

More precise:

Normally, <command>CHECKPOINT</command> does not flush dirty buffers of
unlogged relations. This option, which is disabled by default, enables
flushing unlogged relations to disk.

Christoph

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2025-07-09 21:31:56 Re: Improving and extending int128.h to more of numeric.c
Previous Message David G. Johnston 2025-07-09 21:18:45 Re: Should TRUNCATE fire DDL triggers