Re: Stack-based tracking of per-node WAL/buffer usage
Lukas Fittl <lukas@fittl.com>
From: Lukas Fittl <lukas@fittl.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Zsolt Parragi <zsolt.parragi@percona.com>,
Andres Freund <andres@anarazel.de>, Tomas Vondra <tomas@vondra.me>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Peter Smith <smithpb2250@gmail.com>
Date: 2026-03-27T07:21:23Z
Lists: pgsql-hackers
Attachments
- v11-0001-instrumentation-Separate-trigger-logic-from-othe.patch (application/octet-stream) patch v11-0001
- v11-0003-instrumentation-Replace-direct-changes-of-pgBuff.patch (application/octet-stream) patch v11-0003
- v11-0002-instrumentation-Separate-per-node-logic-from-oth.patch (application/octet-stream) patch v11-0002
- v11-0004-instrumentation-Add-additional-regression-tests-.patch (application/octet-stream) patch v11-0004
- v11-0005-Optimize-measuring-WAL-buffer-usage-through-stac.patch (application/octet-stream) patch v11-0005
- v11-0009-Add-test_session_buffer_usage-test-module.patch (application/octet-stream) patch v11-0009
- v11-0006-instrumentation-Use-Instrumentation-struct-for-p.patch (application/octet-stream) patch v11-0006
- v11-0007-instrumentation-Optimize-ExecProcNodeInstr-instr.patch (application/octet-stream) patch v11-0007
- v11-0008-Index-scans-Show-table-buffer-accesses-separatel.patch (application/octet-stream) patch v11-0008
On Wed, Mar 25, 2026 at 5:41 PM Lukas Fittl <lukas@fittl.com> wrote: > On Wed, Mar 25, 2026 at 3:47 AM Heikki Linnakangas <hlinnaka@iki.fi> wrote: > > This patch could use an overview README file, I'm struggling to > > understand how the this all works. Here's my understanding so far, > > please correct me if I'm wrong: > > Sure, happy to put this together - I wonder where would place that > best - probably src/backend/executor/README.instrument ? I've gone ahead and added that in src/backend/executor/README.instrument for now, trying to take some of your prior email as inspiration, whilst not fully committing to describing it as a tree - but happy to revise that if we feel its important for clarity. See attached v11, rebased after the pgBufferUsage calls were moved in df09452c3209, and also fixing the issues that Zsolt noted in a previous email reviewing v10. I've also moved pg_session_buffer_usage to be a test_session_buffer_usage module instead, since its not intended as a user accessible module. If we wanted to commit that (not sure if its worth the cycles), we could potentially merge it with the 0004 commit that expands the main regression tests. Thanks, Lukas -- Lukas Fittl
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
instrumentation: Allocate query level instrumentation in ExecutorStart
- 2c16deee2f7d 19 (unreleased) landed
-
instrumentation: Move ExecProcNodeInstr to allow inlining
- 544000288ec8 19 (unreleased) landed
-
instrumentation: Separate per-node logic from other uses
- 5a79e78501f4 19 (unreleased) landed
-
instrumentation: Separate trigger logic from other uses
- 7d9b74df53e9 19 (unreleased) landed
-
instrumentation: Rename INSTR_TIME_LT macro to INSTR_TIME_GT
- 3218825271bd 19 (unreleased) landed
-
instrumentation: Keep time fields as instrtime, convert in callers
- e5a5e0a90750 19 (unreleased) landed