Re: strange perf regression with data checksums
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Tomas Vondra <tomas@vondra.me>, Aleksander Alekseev <aleksander@timescale.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-05-21T16:29:11Z
Lists: pgsql-hackers
Hi, On 2025-05-19 15:45:01 -0400, Peter Geoghegan wrote: > On Mon, May 19, 2025 at 3:37 PM Andres Freund <andres@anarazel.de> wrote: > > I think we can do better - something like > > > > #ifdef PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY > > lsn = PageGetLSN(page); > > #else > > buf_state = LockBufHdr(bufHdr); > > lsn = PageGetLSN(page); > > UnlockBufHdr(bufHdr, buf_state); > > #endif > > > > All perf relevant systems support reading 8 bytes without a chance of > > tearing... > > Even assuming that this scheme works perfectly, I'd still like to > pursue the idea I had about fixing this in nbtree. > > The relevant nbtree code seems more elegant if we avoid calling > BufferGetLSNAtomic() unless and until its return value might actually > be useful. It's quite a lot easier to understand the true purpose of > so->currPos.lsn with this new structure. I'm not against that - ISTM we should do both. Greetings, Andres Freund
Commits
-
Make _bt_killitems drop pins it acquired itself.
- 7c319f54917f 18.0 landed
- 40aa5ddea1c0 17.6 landed
- c7f25feb3862 16.10 landed
- d2ec671092a1 15.14 landed
- 7c7c0a77dc8a 14.19 landed
- 38c8d298704c 13.22 landed
-
Avoid BufferGetLSNAtomic() calls during nbtree scans.
- e6eed40e4441 18.0 landed
-
Reduce pinning and buffer content locking for btree scans.
- 2ed5b87f96d4 9.5.0 cited