]> git.ipfire.org Git - thirdparty/postgresql.git/commit
instrumentation: Separate trigger logic from other uses
authorAndres Freund <andres@anarazel.de>
Sun, 5 Apr 2026 20:47:12 +0000 (16:47 -0400)
committerAndres Freund <andres@anarazel.de>
Sun, 5 Apr 2026 20:56:50 +0000 (16:56 -0400)
commit7d9b74df53e9268bd638274f1415ebfeecf0de51
treed467d39578c8dc2d09e6c2ce5a1aa89ae1570061
parent6c7bce28c83f4deaa6a6205dc32e86ac1630182c
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
contrib/auto_explain/auto_explain.c
contrib/pg_stat_statements/pg_stat_statements.c
src/backend/commands/explain.c
src/backend/commands/trigger.c
src/backend/executor/execMain.c
src/backend/executor/execProcnode.c
src/backend/executor/instrument.c
src/include/executor/instrument.h
src/include/nodes/execnodes.h
src/tools/pgindent/typedefs.list