On Tue, Feb 3, 2026 at 3:02 AM Tomas Vondra <[email protected]> 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
