{"Entry":{"collection":"hook","key":"explain_per_plan_hook","name":"explain_per_plan_hook","aliases":[],"metadata":{"aliases":[],"category":"EXPLAIN","content_hash":"d55ec38de69f573d58ad77a9cf057c2ba1e65610377ff3216659f0ccbe7e5e27","imported_at":"2026-09-30T17:44:22.440573+08:00","name":"explain_per_plan_hook","name_zh":"explain_per_plan_hook","slug":"explain_per_plan_hook","summary":"Hook for EXPLAIN plugins to print extra information for each plan"}},"Definition":{"Collection":"hook","Key":"explain_per_plan_hook","SourceDatabase":"center","Version":"18","SourceTable":"hook","SourceKey":"explain_per_plan_hook","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","Facts":{"description":["Hook for EXPLAIN plugins to print extra information for each plan"],"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)"}],"related":[{"label":"EXPLAIN","url":"/wiki/sql/explain/?v=18"}],"release":{"channel":"stable","label":"18","major":"18","ref":"REL_18_STABLE","revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd"},"sections":[{"paragraphs":["per-plan and per-node hooks for plugins to print additional info","Allow plugins to print additional information"],"title":"Core source comments"},{"paragraphs":["src/backend/commands/explain.c:650"],"title":"Call sites"},{"code":"\t/* Print info about serialization of output */\n\tif (es-\u003eserialize != EXPLAIN_SERIALIZE_NONE)\n\t\tExplainPrintSerialize(es, \u0026serializeMetrics);\n\n\t/* Allow plugins to print additional information */\n\tif (explain_per_plan_hook)\n\t\t(*explain_per_plan_hook) (plannedstmt, into, es, queryString,\n\t\t\t\t\t\t\t\t  params, queryEnv);\n\n\t/*\n\t * Close down the query and free resources.  Include time for this in the\n\t * total execution time (although it should be pretty minimal).\n\t */\n\tINSTR_TIME_SET_CURRENT(starttime);\n","paragraphs":[],"title":"Core call context: src/backend/commands/explain.c:644–658"}],"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;","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#L32"},{"label":"Core definition","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L56"},{"label":"Call sites","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L650"}]},"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#L32"},{"label":"Core definition","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L56"},{"label":"Call sites","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L650"}]},"MeasuredEvidence":{}},"Text":{"Collection":"hook","Key":"explain_per_plan_hook","SourceDatabase":"center","Version":"18","Locale":"en","Title":"explain_per_plan_hook","Summary":"Hook for EXPLAIN plugins to print extra information for each plan","BodyHTML":"\u003cp\u003eHook for EXPLAIN plugins to print extra information for each plan\u003c/p\u003e","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","ContentHash":"e2369c4fcf22777e33448479912322ad51d205895c9738c3bcbff35e76ec19f2","Payload":{"description":["Hook for EXPLAIN plugins to print extra information for each plan"],"related":[{"label":"EXPLAIN","url":"/wiki/sql/explain/?v=18"}],"sections":[{"paragraphs":["per-plan and per-node hooks for plugins to print additional info","Allow plugins to print additional information"],"title":"Core source comments"},{"paragraphs":["src/backend/commands/explain.c:650"],"title":"Call sites"},{"code":"\t/* Print info about serialization of output */\n\tif (es-\u003eserialize != EXPLAIN_SERIALIZE_NONE)\n\t\tExplainPrintSerialize(es, \u0026serializeMetrics);\n\n\t/* Allow plugins to print additional information */\n\tif (explain_per_plan_hook)\n\t\t(*explain_per_plan_hook) (plannedstmt, into, es, queryString,\n\t\t\t\t\t\t\t\t  params, queryEnv);\n\n\t/*\n\t * Close down the query and free resources.  Include time for this in the\n\t * total execution time (although it should be pretty minimal).\n\t */\n\tINSTR_TIME_SET_CURRENT(starttime);\n","paragraphs":[],"title":"Core call context: src/backend/commands/explain.c:644–658"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
