explain_per_plan_hook
explain_per_plan_hook
Hook for EXPLAIN plugins to print extra information for each plan
Reading PostgreSQL 18.
Description
Hook for EXPLAIN plugins to print extra information for each plan
- Interface type
- explain_per_plan_hook_type
- Header
- src/include/commands/explain.h
- Subsystem
- EXPLAIN
- Initial value
- NULL (no hook installed)
C interface
typedef void (*explain_per_plan_hook_type) (PlannedStmt *plannedstmt, IntoClause *into, struct ExplainState *es, const char *queryString, ParamListInfo params, QueryEnvironment *queryEnv);
extern PGDLLIMPORT explain_per_plan_hook_type explain_per_plan_hook;Core source comments
per-plan and per-node hooks for plugins to print additional info
Allow plugins to print additional information
Call sites
src/backend/commands/explain.c:650
Core call context: src/backend/commands/explain.c:644–658
/* Print info about serialization of output */
if (es->serialize != EXPLAIN_SERIALIZE_NONE)
ExplainPrintSerialize(es, &serializeMetrics);
/* Allow plugins to print additional information */
if (explain_per_plan_hook)
(*explain_per_plan_hook) (plannedstmt, into, es, queryString,
params, queryEnv);
/*
* Close down the query and free resources. Include time for this in the
* total execution time (although it should be pretty minimal).
*/
INSTR_TIME_SET_CURRENT(starttime);
Related entries
Documentation and source
Source build
- Version
- 18
- Build
- REL_18_STABLE
- Source fingerprint
753057e340da8f22e57c9a409ea7a235fd6a46bd
Compare versions
PostgreSQL 17 → 18: added.
--- PostgreSQL 17
+++ PostgreSQL 18
@@ -1 +1,22 @@
-Not recorded in this version
+{
+ "facts": [
+ {
+ "label": "Interface type",
+ "value": "explain_per_plan_hook_type"
+ },
+ {
+ "label": "Header",
+ "value": "src/include/commands/explain.h"
+ },
+ {
+ "label": "Subsystem",
+ "value": "EXPLAIN"
+ },
+ {
+ "label": "Initial value",
+ "value": "NULL (no hook installed)"
+ }
+ ],
+ "signature": "typedef void (*explain_per_plan_hook_type) (PlannedStmt *plannedstmt, IntoClause *into, struct ExplainState *es, const char *queryString, ParamListInfo params, QueryEnvironment *queryEnv);\nextern PGDLLIMPORT explain_per_plan_hook_type explain_per_plan_hook;",
+ "tables": null
+}
Compares recorded interfaces and attributes. Source fingerprints and build metadata are excluded; an absent sample is not proof of the introduction or removal release.
Related entries
ExplainOneQuery_hookExplainOneQuery_hookexplain_get_index_name_hookexplain_get_index_name_hookexplain_per_node_hookexplain_per_node_hookexplain_validate_options_hookexplain_validate_options_hook
Export JSON · Back to Hooks · Recorded in PostgreSQL 18 through 20; the first sample is not necessarily its introduction.