Re: Stack-based tracking of per-node WAL/buffer usage
Lukas Fittl <lukas@fittl.com>
From: Lukas Fittl <lukas@fittl.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Andres Freund <andres@anarazel.de>
Cc: Peter Smith <smithpb2250@gmail.com>
Date: 2026-03-08T04:31:07Z
Lists: pgsql-hackers
On Sat, Mar 7, 2026 at 8:27 PM Lukas Fittl <lukas@fittl.com> wrote: > Example (default shared_buffers, runtimes are best out of 3-ish): > > CREATE TABLE lotsarows(key int not null); > INSERT INTO lotsarows SELECT generate_series(1, 50000000); > VACUUM FREEZE lotsarows; > > 250ms actual runtime (no instrumentation) > > BUFFERS OFF, TIMING OFF: > 295ms master > 295ms with stack-based instrumentation only (v7/0005) -- no change > because BUFFERS OFF > 260ms with ExecProcNodeInstr inlining work (v7/0006) > > BUFFERS ON, TIMING OFF: > 380ms master > 305ms with stack-based instrumentation only (v7/0005) > 280ms with ExecProcNodeInstr inlining work (v7/0006) > > In summary: For BUFFERS ON, we're going from 52% overhead in this > stress test, to 12% overhead (22% without the ExecProcNodeInstr > change). With rows instrumentation only, we go from 18% to 3% > overhead. Erm, and I forgot the query here, this is testing "SELECT count(*) FROM lotsarows;", just like over in [0]. Thanks, Lukas [0]: https://www.postgresql.org/message-id/flat/20200612232810.f46nbqkdhbutzqdg@alap3.anarazel.de -- 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