pgsql: instrumentation: Separate trigger logic from other uses

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: instrumentation: Separate trigger logic from other uses
Date: 2026-04-05 21:02:25
Message-ID: E1w9Ubw-0038O2-28@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)fittl(dot)com>
Reviewed-by: Andres Freund <andres(at)anarazel(dot)de>
Discussion: https://www.postgresql.org/message-id/flat/CAP53PkzdBK8VJ1fS4AZ481LgMN8f9mJiC39ZRHqkFUSYq6KWmg(at)mail(dot)gmail(dot)com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7d9b74df53e9268bd638274f1415ebfeecf0de51

Modified Files
--------------
contrib/auto_explain/auto_explain.c | 2 +-
contrib/pg_stat_statements/pg_stat_statements.c | 2 +-
src/backend/commands/explain.c | 21 +++++------
src/backend/commands/trigger.c | 22 ++++++------
src/backend/executor/execMain.c | 2 +-
src/backend/executor/execProcnode.c | 2 +-
src/backend/executor/instrument.c | 48 +++++++++++++++++--------
src/include/executor/instrument.h | 15 ++++++--
src/include/nodes/execnodes.h | 3 +-
src/tools/pgindent/typedefs.list | 1 +
10 files changed, 75 insertions(+), 43 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2026-04-05 23:11:55 pgsql: instrumentation: Separate per-node logic from other uses
Previous Message Andres Freund 2026-04-05 20:03:33 pgsql: Fixups for a4f774cf1c7