{"Entry":{"collection":"hook","key":"explain_per_node_hook","name":"explain_per_node_hook","aliases":[],"metadata":{"aliases":[],"category":"EXPLAIN","content_hash":"d4d06aa92753f0465df6320ff99d3c00205f04e0d6500a2241f4d74b35fa4ee2","derived_content_hash":"d5ab7923a30fd30c481469e5005c18c5cc4f7c903694f7eac8b79fc311952d4b","imported_at":"2026-09-30T17:44:22.435823+08:00","name":"explain_per_node_hook","name_zh":"explain_per_node_hook","repair_provenance":{"original_source_revision":"","receipt_sha256":"9fadd8a498d5b64f8818f463e284481174b39df9a9b6dd694cf43f092bc36498","repair":"wiki-repair-20261023"},"slug":"explain_per_node_hook","source_rev":"wiki-repair-20261023:99c2265ef834975a10ffbf1fb103c45d2e3e40a3cb1ac6d1a4b0867fd7998b9c","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"],"description_zh":"供 EXPLAIN 插件在单个计划节点上输出额外字段的钩子。","description_zh_html":"\u003cp\u003e供 EXPLAIN 插件在单个计划节点上输出额外字段的钩子。\u003c/p\u003e\u003cp\u003e以下中文为本站依据所列 PostgreSQL 源码注释编译的说明。\u003c/p\u003e\u003ch3\u003e接口声明\u003c/h3\u003e\u003cpre\u003etypedef 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;\u003c/pre\u003e\u003ch3\u003e源码说明\u003c/h3\u003e\u003cp\u003e允许插件输出额外信息。\u003c/p\u003e\u003ch3\u003e调用位置\u003c/h3\u003e\u003cul\u003e\u003cli\u003e\u003ccode\u003esrc/backend/commands/explain.c:2319\u003c/code\u003e\u003c/li\u003e\u003c/ul\u003e\u003ch3\u003e核心调用上下文：src/backend/commands/explain.c:2313–2327\u003c/h3\u003e\u003cpre\u003e\tif (es-\u0026gt;workers_state)\n\t\tExplainFlushWorkersState(es);\n\tes-\u0026gt;workers_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\u0026#x27;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\u003c/pre\u003e","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"}],"translation_provenance":{"inputs":[{"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"}],"kind":"authored-source-translation","locale":"zh-Hans","source_revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","translated_source_sha256":"31769c113ea117c509411d05657e237dddd7382548c5724be98b82ecacfc57e3","version":"18"},"zh_from":"authored-source-translation"},"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":"en","Fallback":false,"Versions":["18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
