{"Entry":{"collection":"hook","key":"explainonequery_hook","name":"ExplainOneQuery_hook","aliases":[],"metadata":{"aliases":[],"category":"EXPLAIN","content_hash":"04f1f3dafaf5445b5d2fea4dc5acec7a730745ce1a66a4465643794380b2c2c0","imported_at":"2026-09-30T17:44:22.446632+08:00","name":"ExplainOneQuery_hook","name_zh":"ExplainOneQuery_hook","slug":"explainonequery_hook","summary":"Hook for plugins to get control in ExplainOneQuery()"}},"Definition":{"Collection":"hook","Key":"explainonequery_hook","SourceDatabase":"center","Version":"18","SourceTable":"hook","SourceKey":"explainonequery_hook","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","Facts":{"description":["Hook for plugins to get control in ExplainOneQuery()"],"facts":[{"label":"Interface type","value":"ExplainOneQuery_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":["if an advisor plugin is present, let it manage things"],"title":"Core source comments"},{"paragraphs":["src/backend/commands/explain.c:306"],"title":"Call sites"},{"code":"\t\tExplainOneUtility(query-\u003eutilityStmt, into, es, pstate, params);\n\t\treturn;\n\t}\n\n\t/* if an advisor plugin is present, let it manage things */\n\tif (ExplainOneQuery_hook)\n\t\t(*ExplainOneQuery_hook) (query, cursorOptions, into, es,\n\t\t\t\t\t\t\t\t pstate-\u003ep_sourcetext, params, pstate-\u003ep_queryEnv);\n\telse\n\t\tstandard_ExplainOneQuery(query, cursorOptions, into, es,\n\t\t\t\t\t\t\t\t pstate-\u003ep_sourcetext, params, pstate-\u003ep_queryEnv);\n}\n\n/*\n * standard_ExplainOneQuery -","paragraphs":[],"title":"Core call context: src/backend/commands/explain.c:300–314"}],"signature":"typedef void (*ExplainOneQuery_hook_type) (Query *query, int cursorOptions, IntoClause *into, struct ExplainState *es, const char *queryString, ParamListInfo params, QueryEnvironment *queryEnv);\nextern PGDLLIMPORT ExplainOneQuery_hook_type ExplainOneQuery_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#L22"},{"label":"Core definition","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L50"},{"label":"Call sites","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L306"}]},"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#L22"},{"label":"Core definition","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L50"},{"label":"Call sites","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L306"}]},"MeasuredEvidence":{}},"Text":{"Collection":"hook","Key":"explainonequery_hook","SourceDatabase":"center","Version":"18","Locale":"en","Title":"ExplainOneQuery_hook","Summary":"Hook for plugins to get control in ExplainOneQuery()","BodyHTML":"\u003cp\u003eHook for plugins to get control in ExplainOneQuery()\u003c/p\u003e","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","ContentHash":"1b592052b6aebb8d7c73f93c9ad9d638af78ae99385f8f9922c2c48a8c2aef75","Payload":{"description":["Hook for plugins to get control in ExplainOneQuery()"],"related":[{"label":"EXPLAIN","url":"/wiki/sql/explain/?v=18"}],"sections":[{"paragraphs":["if an advisor plugin is present, let it manage things"],"title":"Core source comments"},{"paragraphs":["src/backend/commands/explain.c:306"],"title":"Call sites"},{"code":"\t\tExplainOneUtility(query-\u003eutilityStmt, into, es, pstate, params);\n\t\treturn;\n\t}\n\n\t/* if an advisor plugin is present, let it manage things */\n\tif (ExplainOneQuery_hook)\n\t\t(*ExplainOneQuery_hook) (query, cursorOptions, into, es,\n\t\t\t\t\t\t\t\t pstate-\u003ep_sourcetext, params, pstate-\u003ep_queryEnv);\n\telse\n\t\tstandard_ExplainOneQuery(query, cursorOptions, into, es,\n\t\t\t\t\t\t\t\t pstate-\u003ep_sourcetext, params, pstate-\u003ep_queryEnv);\n}\n\n/*\n * standard_ExplainOneQuery -","paragraphs":[],"title":"Core call context: src/backend/commands/explain.c:300–314"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
