Re: Non-deterministic buffer counts reported in execution with EXPLAIN ANALYZE BUFFERS - Mailing list pgsql-hackers

From Lukas Fittl
Subject Re: Non-deterministic buffer counts reported in execution with EXPLAIN ANALYZE BUFFERS
Date
Msg-id CAP53PkxOX5ZBO76moCW=CykiwBhJSewq2UnQrLgrGwJg=Kaimg@mail.gmail.com
Whole thread Raw
In response to Re: Non-deterministic buffer counts reported in execution with EXPLAIN ANALYZE BUFFERS  (Tomas Vondra <tomas@vondra.me>)
List pgsql-hackers
On Tue, Feb 3, 2026 at 3:02 AM Tomas Vondra <tomas@vondra.me> wrote:
> Perhaps we could identify buffer accesses from syscache lookups, and
> track those separately? Then we'd know which of the hits/reads are from
> "actual" execution.

Doing this in the current infrastructure (with the global
pgBufferUsage counters) is pretty expensive I think, since we'd need
to do an extra call to BufferUsageAccumDiff after syscache lookups, to
get the buffer usage just for that activity.

If splitting out buffers by syscache vs others is of interest, I would
welcome review of the stack-based instrumentation patch over at [0],
which has an example of how it can be used to more easily break Index
Scans out into index and table access - the same logic could be
applied to syscache lookups I think.

[0]:
https://www.postgresql.org/message-id/flat/CAP53Pkw85U-aMRzkZ%2BkRKfCh0pA5vyo%3D_W16gPK4sirZxiJy%3DA%40mail.gmail.com#170c740dbeb87d25d3f921ab28e4bb40

Thanks,
Lukas

--
Lukas Fittl



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Remove unused isCommit parameter from AtEOXact_LocalBuffers
Next
From: Adrien Nayrat
Date:
Subject: Re: Change default of jit to off