Re: strange perf regression with data checksums

Peter Geoghegan <pg@bowt.ie>

From: Peter Geoghegan <pg@bowt.ie>
To: Mihail Nikalayeu <mihailnikalayeu@gmail.com>
Cc: Tomas Vondra <tomas@vondra.me>, Aleksander Alekseev <aleksander@timescale.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-06-09T14:49:27Z
Lists: pgsql-hackers
On Mon, Jun 9, 2025 at 8:48 AM Mihail Nikalayeu
<mihailnikalayeu@gmail.com> wrote:
> I was rebasing [0] and noticed dropPin is not initialized in
> btbeginscan, which seems to be suspicious for me.
> Is it intended?

That's pretty normal. We don't have access to the scan descriptor
within btbeginscan.

This is also why we do things like allocate so->currTuples within
btrescan. We don't yet know if the scan will be an index-only scan
when btbeginscan is called.

-- 
Peter Geoghegan



Commits

  1. Make _bt_killitems drop pins it acquired itself.

  2. Avoid BufferGetLSNAtomic() calls during nbtree scans.

  3. Reduce pinning and buffer content locking for btree scans.