{"Entry":{"collection":"hook","key":"explain_per_node_hook","name":"explain_per_node_hook","aliases":[],"metadata":{"aliases":[],"category":"EXPLAIN","content_hash":"d4d06aa92753f0465df6320ff99d3c00205f04e0d6500a2241f4d74b35fa4ee2","imported_at":"2026-09-30T17:44:22.435823+08:00","name":"explain_per_node_hook","name_zh":"explain_per_node_hook","slug":"explain_per_node_hook","summary":"Hook for EXPLAIN plugins to print extra fields on individual plan nodes"}},"Definition":{"Collection":"hook","Key":"explain_per_node_hook","SourceDatabase":"center","Version":"18","SourceTable":"hook","SourceKey":"explain_per_node_hook","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","Facts":{"description":["Hook for EXPLAIN plugins to print extra fields on individual plan nodes"],"facts":[{"label":"Interface type","value":"explain_per_node_hook_type"},{"label":"Header","value":"src/include/commands/explain.h"},{"label":"Subsystem","value":"EXPLAIN"},{"label":"Initial value","value":"NULL (no hook installed)"}],"related":[{"label":"EXPLAIN","url":"/wiki/sql/explain/?v=18"}],"release":{"channel":"stable","label":"18","major":"18","ref":"REL_18_STABLE","revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd"},"sections":[{"paragraphs":["Allow plugins to print additional information"],"title":"Core source comments"},{"paragraphs":["src/backend/commands/explain.c:2319"],"title":"Call sites"},{"code":"\tif (es-\u003eworkers_state)\n\t\tExplainFlushWorkersState(es);\n\tes-\u003eworkers_state = save_workers_state;\n\n\t/* Allow plugins to print additional information */\n\tif (explain_per_node_hook)\n\t\t(*explain_per_node_hook) (planstate, ancestors, relationship,\n\t\t\t\t\t\t\t\t  plan_name, es);\n\n\t/*\n\t * If partition pruning was done during executor initialization, the\n\t * number of child plans we'll display below will be less than the number\n\t * of subplans that was specified in the plan.  To make this a bit less\n\t * mysterious, emit an indication that this happened.  Note that this\n\t * field is emitted now because we want it to be a property of the parent","paragraphs":[],"title":"Core call context: src/backend/commands/explain.c:2313–2327"}],"signature":"typedef void (*explain_per_node_hook_type) (PlanState *planstate, List *ancestors, const char *relationship, const char *plan_name, struct ExplainState *es);\nextern PGDLLIMPORT explain_per_node_hook_type explain_per_node_hook;","sources":[{"label":"Interface declaration","path":"src/include/commands/explain.h","sha256":"a8ef9548bccebb3c8f5255e8295d1d53dd0e4ea54b6be8b17dfe163ef2918b7f","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/commands/explain.h#L41"},{"label":"Core definition","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L57"},{"label":"Call sites","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L2319"}]},"ManualEvidence":{"release":{"channel":"stable","label":"18","major":"18","ref":"REL_18_STABLE","revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd"},"sources":[{"label":"Interface declaration","path":"src/include/commands/explain.h","sha256":"a8ef9548bccebb3c8f5255e8295d1d53dd0e4ea54b6be8b17dfe163ef2918b7f","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/commands/explain.h#L41"},{"label":"Core definition","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L57"},{"label":"Call sites","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L2319"}]},"MeasuredEvidence":{}},"Text":{"Collection":"hook","Key":"explain_per_node_hook","SourceDatabase":"center","Version":"18","Locale":"en","Title":"explain_per_node_hook","Summary":"Hook for EXPLAIN plugins to print extra fields on individual plan nodes","BodyHTML":"\u003cp\u003eHook for EXPLAIN plugins to print extra fields on individual plan nodes\u003c/p\u003e","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","ContentHash":"7d33c197394b3bba4cfe28c064da6b75b0b8214fbda01968f6956cb8e91de2db","Payload":{"description":["Hook for EXPLAIN plugins to print extra fields on individual plan nodes"],"related":[{"label":"EXPLAIN","url":"/wiki/sql/explain/?v=18"}],"sections":[{"paragraphs":["Allow plugins to print additional information"],"title":"Core source comments"},{"paragraphs":["src/backend/commands/explain.c:2319"],"title":"Call sites"},{"code":"\tif (es-\u003eworkers_state)\n\t\tExplainFlushWorkersState(es);\n\tes-\u003eworkers_state = save_workers_state;\n\n\t/* Allow plugins to print additional information */\n\tif (explain_per_node_hook)\n\t\t(*explain_per_node_hook) (planstate, ancestors, relationship,\n\t\t\t\t\t\t\t\t  plan_name, es);\n\n\t/*\n\t * If partition pruning was done during executor initialization, the\n\t * number of child plans we'll display below will be less than the number\n\t * of subplans that was specified in the plan.  To make this a bit less\n\t * mysterious, emit an indication that this happened.  Note that this\n\t * field is emitted now because we want it to be a property of the parent","paragraphs":[],"title":"Core call context: src/backend/commands/explain.c:2313–2327"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
