agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: instrumentation: Separate trigger logic from other uses
Date: Sun, 05 Apr 2026 21:02:25 +0000
Message-ID: <E1w9Ubw-0038O2-28@gemulon.postgresql.org> (raw)

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....

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(-)



Message-ID: <E1w9Ubw-0038O2-28@gemulon.postgresql.org>
Permalink:  ../E1w9Ubw-0038O2-28@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w9Ubw-0038O2-28@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: instrumentation: Separate trigger logic from other uses
  In-Reply-To: <E1w9Ubw-0038O2-28@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox