Documentation / Extension Hooks / EXPLAIN
explain_per_node_hook
explain_per_node_hook
Hook for EXPLAIN plugins to print extra fields on individual plan nodes
Reading PostgreSQL 18.
Description
Hook for EXPLAIN plugins to print extra fields on individual plan nodes
- Interface type
- explain_per_node_hook_type
- Header
- src/include/commands/explain.h
- Subsystem
- EXPLAIN
- Initial value
- NULL (no hook installed)
C interface
typedef void (*explain_per_node_hook_type) (PlanState *planstate, List *ancestors, const char *relationship, const char *plan_name, struct ExplainState *es);
extern PGDLLIMPORT explain_per_node_hook_type explain_per_node_hook;Core source comments
Allow plugins to print additional information
Call sites
src/backend/commands/explain.c:2319
Core call context: src/backend/commands/explain.c:2313–2327
if (es->workers_state)
ExplainFlushWorkersState(es);
es->workers_state = save_workers_state;
/* Allow plugins to print additional information */
if (explain_per_node_hook)
(*explain_per_node_hook) (planstate, ancestors, relationship,
plan_name, es);
/*
* If partition pruning was done during executor initialization, the
* number of child plans we'll display below will be less than the number
* of subplans that was specified in the plan. To make this a bit less
* mysterious, emit an indication that this happened. Note that this
* field is emitted now because we want it to be a property of the parentRelated entries
Documentation and source
Source build
- Version
- 18
- Build
- REL_18_STABLE
- Source fingerprint
753057e340da8f22e57c9a409ea7a235fd6a46bd
Related entries
ExplainOneQuery_hookExplainOneQuery_hookexplain_get_index_name_hookexplain_get_index_name_hookexplain_per_plan_hookexplain_per_plan_hookexplain_validate_options_hookexplain_validate_options_hook
Back to Extension Hooks · Recorded in PostgreSQL 18 through 20; the first sample is not necessarily its introduction.