Document for wal_log_hints

Started by Andy Fanalmost 2 years ago3 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

appliessuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t50591
psql -h localhost -U postgres

Built from patchset v1 (message #1), September 20, 2026 at 04:08 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t50591_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t50591_1 && git checkout t50591_1

Patchset v1 (message #1) is on t50591_1

Jump to latest
#1Andy Fan
zhihui.fan1213@gmail.com

Hi,

When I read the document for wal_log_hints, I see:

<para>
If data checksums are enabled, hint bit updates are always WAL-logged
and this setting is ignored. You can use this setting to test how much
extra WAL-logging would occur if your database had data checksums
enabled.
</para>

I think if it should be changed to ".. if your database had data
checksums *disabled*".

Per my check, wal_log_hints is not used except the case:

#define XLogHintBitIsNeeded() (DataChecksumsEnabled() || wal_log_hints)

So if data checksums is enabled, nothing can be tested when turning
wal_log_hints on/off.

--
Best Regards
Andy Fan

Attachments:

t50591_1
v1-0001-doc-correct-the-method-to-test-the-impact-of-wal_.patchtext/x-diffDownload+1-2
#2Michael Paquier
michael@paquier.xyz
In reply to: Andy Fan (#1)
Re: Document for wal_log_hints

On Tue, Nov 19, 2024 at 09:03:57AM +0800, Andy Fan wrote:

So if data checksums is enabled, nothing can be tested when turning
wal_log_hints on/off.
@@ -3319,7 +3319,7 @@ include_dir 'conf.d'
If data checksums are enabled, hint bit updates are always WAL-logged
and this setting is ignored. You can use this setting to test how much
extra WAL-logging would occur if your database had data checksums
- enabled.
+ disabled.
</para>

It seems to me that the point if that enabling wal_log_hints is able
to emulate how much WAL would be generated should data checksums be
*enabled*. So the original text looks correct to me.
--
Michael

#3Andy Fan
zhihui.fan1213@gmail.com
In reply to: Michael Paquier (#2)
Re: Document for wal_log_hints

Michael Paquier <michael@paquier.xyz> writes:

On Tue, Nov 19, 2024 at 09:03:57AM +0800, Andy Fan wrote:

So if data checksums is enabled, nothing can be tested when turning
wal_log_hints on/off.
@@ -3319,7 +3319,7 @@ include_dir 'conf.d'
If data checksums are enabled, hint bit updates are always WAL-logged
and this setting is ignored. You can use this setting to test how much
extra WAL-logging would occur if your database had data checksums
- enabled.
+ disabled.
</para>

It seems to me that the point if that enabling wal_log_hints is able
to emulate how much WAL would be generated should data checksums be
*enabled*. So the original text looks correct to me.

OK.. your explainatin looks good to me. so we should keep the original
one. Thanks for the check!

--
Best Regards
Andy Fan