instrumentation: Separate trigger logic from other uses
Andres Freund <andres@anarazel.de>
instrumentation: Separate trigger logic from other uses Introduce TriggerInstrumentation to capture trigger timing and firings (previously counted in "ntuples"), to aid a future refactoring that splits out all Instrumentation fields beyond timing and WAL/buffers into more specific structs. In passing, drop the "n" argument to InstrAlloc, as all remaining callers need exactly one Instrumentation struct. The duplication between InstrAlloc() and InstrInit(), as well as the conditional initialization of async_mode will be addressed in a subsequent commit. Author: Lukas Fittl <lukas@fittl.com> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://www.postgresql.org/message-id/flat/CAP53PkzdBK8VJ1fS4AZ481LgMN8f9mJiC39ZRHqkFUSYq6KWmg@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| contrib/auto_explain/auto_explain.c | modified | +1 −1 |
| contrib/pg_stat_statements/pg_stat_statements.c | modified | +1 −1 |
| src/backend/commands/explain.c | modified | +11 −10 |
| src/backend/commands/trigger.c | modified | +11 −11 |
| src/backend/executor/execMain.c | modified | +1 −1 |
| src/backend/executor/execProcnode.c | modified | +1 −1 |
| src/backend/executor/instrument.c | modified | +33 −15 |
| src/include/executor/instrument.h | modified | +13 −2 |
| src/include/nodes/execnodes.h | modified | +2 −1 |
| src/tools/pgindent/typedefs.list | modified | +1 −0 |
Discussion
- Stack-based tracking of per-node WAL/buffer usage 48 messages · 2025-08-31 → 2026-04-08