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 <[email protected]>
Reviewed-by: Andres Freund <[email protected]>
Discussion: 
https://www.postgresql.org/message-id/flat/cap53pkzdbk8vj1fs4az481lgmn8f9mjic39zrhqkfusyq6k...@mail.gmail.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(-)

Reply via email to