postgresql/src/include/nodes
Andres Freund 5a79e78501 instrumentation: Separate per-node logic from other uses
Previously, different places (e.g. query "total time") were repurposing the
Instrumentation struct initially introduced for capturing per-node statistics
during execution. This overuse of the same struct is confusing, e.g. by
cluttering calls of InstrStartNode/InstrStopNode in unrelated code paths, and
prevents future refactorings.

Instead, simplify the Instrumentation struct to only track time and WAL/buffer
usage. Similarly, drop the use of InstrEndLoop outside of per-node
instrumentation - these calls were added without any apparent benefit since
the relevant fields were never read.

Introduce the NodeInstrumentation struct to carry forward the per-node
instrumentation information. WorkerInstrumentation is renamed to
WorkerNodeInstrumentation for clarity.

In passing, clarify that InstrAggNode is expected to only run after
InstrEndLoop (as it does in practice), and drop unused code.

This also fixes a consequence-less bug: Previously ->async_mode was only set
when a non-zero instrument_option was passed. That turns out to be harmless
right now, as ->async_mode only affects a timing related field.

Author: Lukas Fittl <lukas@fittl.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CAP53PkzdBK8VJ1fS4AZ481LgMN8f9mJiC39ZRHqkFUSYq6KWmg@mail.gmail.com
2026-04-05 19:04:24 -04:00
..
.gitignore Automatically generate node support functions 2022-07-09 08:53:59 +02:00
bitmapset.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
execnodes.h instrumentation: Separate per-node logic from other uses 2026-04-05 19:04:24 -04:00
extensible.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
lockoptions.h Add support for INSERT ... ON CONFLICT DO SELECT. 2026-02-12 09:57:04 +00:00
makefuncs.h Allow IS JSON predicate to work with domain types 2026-03-17 15:20:22 -04:00
memnodes.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
meson.build Update copyright for 2026 2026-01-01 13:24:10 -05:00
miscnodes.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
multibitmapset.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
nodeFuncs.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
nodes.h Change copyObject() to use typeof_unqual 2026-03-13 07:06:57 +01:00
params.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
parsenodes.h Add UPDATE/DELETE FOR PORTION OF 2026-04-01 19:06:03 +02:00
pathnodes.h Add UPDATE/DELETE FOR PORTION OF 2026-04-01 19:06:03 +02:00
pg_list.h Make fixed-length list building macros work in C++ 2026-03-26 08:53:13 +01:00
plannodes.h Add UPDATE/DELETE FOR PORTION OF 2026-04-01 19:06:03 +02:00
primnodes.h Add UPDATE/DELETE FOR PORTION OF 2026-04-01 19:06:03 +02:00
print.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
queryjumble.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
readfuncs.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
replnodes.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
subscripting.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
supportnodes.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
tidbitmap.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
value.h Update copyright for 2026 2026-01-01 13:24:10 -05:00