Re: Enable data checksums by default
Ants Aasma <ants.aasma@cybertec.at>
From: Ants Aasma <ants.aasma@cybertec.at>
To: Tomas Vondra <tomas@vondra.me>
Cc: Greg Burd <greg@burd.me>, Daniel Gustafsson <daniel@yesql.se>, Laurenz Albe <laurenz.albe@cybertec.at>,
Peter Eisentraut <peter@eisentraut.org>, Heikki Linnakangas <hlinnaka@iki.fi>,
Nathan Bossart <nathandbossart@gmail.com>, Greg Sabino Mullane <htamfids@gmail.com>, Bruce Momjian <bruce@momjian.us>, Michael Paquier <michael@paquier.xyz>, Michael Banck <mbanck@gmx.net>,
Jeff Davis <pgsql@j-davis.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2025-08-01T11:37:30Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Avoid BufferGetLSNAtomic() calls during nbtree scans.
- e6eed40e4441 18.0 cited
-
doc PG 18 relnotes: Add incompatibility note about checksums now default
- 48814415d5aa 18.0 landed
-
Fix pg_upgrade's cross-version tests when old < 18
- 38c18710b37a 18.0 landed
-
initdb: Change default to using data checksums.
- 04bec894a04c 18.0 landed
-
Allow TAP tests to force checksums off when calling init()
- e7d0cf42b1ac 18.0 landed
-
initdb: Add new option "--no-data-checksums"
- 983a588e0b86 18.0 landed
-
Tweak docs to reduce possible impact of data checksums
- efd72a3d422b 18.0 landed
On Thu, 31 Jul 2025 at 18:21, Tomas Vondra <tomas@vondra.me> wrote: > I don't know the Intel vs. AMD situation exactly, but e.g. [1] does not > suggest AMD wins by a mile. In fact, it suggests Intel does much better > in this particular benchmark (with AVX-512 improvements). Of course, > this is a fairly recent *kernel* improvement, maybe it wouldn't work for > our data checksums that well. Page checksums are not CRC, but a custom FNV inspired algorithm that rearranges the calculation into 32 parallel ones to extract more instruction level parallelism. With recent improvements in execution capability this is still instruction latency bound - Zen 5 could execute it 3x faster if we widened it 4x. It is especially bound on Intel, as they decided soon after we implemented this algorithm to increase the latency of vpmulld to 10, compared to 3 on AMD. This requires compiling for a target that supports the wide instructions, so it could really use runtime CPU detection to switch between different SIMD width implementations. Even if we made the checksum algorithm itself faster, the main issue is actually memory bandwidth. Intel server CPUs have about half the bandwidth of AMD ones. A checksum has to pull in the whole page in a few hundred cycles. Without checksums only a part of the page might be accessed and the accesses are spread over a longer time, making them easier to hide by out-of-order execution. But all the above still ends up at being a few hundred nanoseconds per buffer read. Basically this ends up only mattering measurably for in-RAM but out of shared buffers workloads. And the easy workaround is to increase shared buffers. As you said, the main issue is the other overheads that checksums pull in. -- Ants Aasma