Re: Stack-based tracking of per-node WAL/buffer usage
Zsolt Parragi <zsolt.parragi@percona.com>
From: Zsolt Parragi <zsolt.parragi@percona.com>
To: Lukas Fittl <lukas@fittl.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Andres Freund <andres@anarazel.de>, Peter Smith <smithpb2250@gmail.com>
Date: 2026-03-10T08:12:56Z
Lists: pgsql-hackers
> ResourceOwnerForgetInstrumentation directly follows the call to > ExecFinalizeNodeInstrumentation in standard_ExecutorFinish, so I'm not > sure which error case you're thinking of? There are a few pallocs between them, so OOM is possible, even if unlikely. I mainly mentioned this because even if unlikely it can happen in theory, and the fix seems simple to me. > I don't think that's a permanent leak, since it would be in the memory > context of the caller, i.e. the per-query memory context Yes, it's definitely not permanent, but could be bad with many tuples. > and so > doing the ResOwner dance for each tuple is probably not ideal. These approaches are interesting, but also add complexity, so I'm unsure which is better for this, the pfree calls add one line and solve the main issue with the current code. > Basically it should be this instead, I think, > so we correctly call the table AM's table_index_fetch_tuple again if > call_again gets set: Right, this code will be better. > I don't know if the extra allocations > really matter, but I can see your point. Yeah, probably doesn't matter that much, but the code also wasn't that nice in that form. I didn't try to actually modify it, but by just looking at it the grouped option seemed cleaner to me, and the output should also be self-explanatory and logical to users.
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