{"Entry":{"collection":"hook","key":"explain_get_index_name_hook","name":"explain_get_index_name_hook","aliases":[],"metadata":{"aliases":[],"category":"EXPLAIN","content_hash":"9f8483f7be0937306baed959b217d025ab079f1a059209a860704e52e2670583","derived_content_hash":"ef2c6166e61b01072e72ad60064ec5a75681468134afd6034886593930addb9f","imported_at":"2026-09-30T17:44:22.423168+08:00","name":"explain_get_index_name_hook","name_zh":"explain_get_index_name_hook","repair_provenance":{"original_source_revision":"","receipt_sha256":"b2565c004966288f8d805f55c99298b2d2f409c5945460cc6e67543ff4df6e03","repair":"wiki-repair-20261023"},"slug":"explain_get_index_name_hook","source_rev":"wiki-repair-20261023:4803425204b6dd9dba3c2ebc9aed7060eefd1c3f83e0b311e982059ba6438b6d","summary":"Hook for plugins to get control in explain_get_index_name()"}},"Definition":{"Collection":"hook","Key":"explain_get_index_name_hook","SourceDatabase":"center","Version":"18","SourceTable":"hook","SourceKey":"explain_get_index_name_hook","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","Facts":{"description":["Hook for plugins to get control in explain_get_index_name()"],"description_zh":"供插件在 explain_get_index_name() 中接管处理的钩子。","description_zh_html":"\u003cp\u003e供插件在 explain_get_index_name() 中接管处理的钩子。\u003c/p\u003e\u003cp\u003e以下中文为本站依据所列 PostgreSQL 源码注释编译的说明。\u003c/p\u003e\u003ch3\u003e接口声明\u003c/h3\u003e\u003cpre\u003etypedef const char *(*explain_get_index_name_hook_type) (Oid indexId);\nextern PGDLLIMPORT explain_get_index_name_hook_type explain_get_index_name_hook;\u003c/pre\u003e\u003ch3\u003e调用位置\u003c/h3\u003e\u003cul\u003e\u003cli\u003e\u003ccode\u003esrc/backend/commands/explain.c:4027\u003c/code\u003e\u003c/li\u003e\u003c/ul\u003e\u003ch3\u003e核心调用上下文：src/backend/commands/explain.c:4021–4035\u003c/h3\u003e\u003cpre\u003estatic const char *\nexplain_get_index_name(Oid indexId)\n{\n\tconst char *result;\n\n\tif (explain_get_index_name_hook)\n\t\tresult = (*explain_get_index_name_hook) (indexId);\n\telse\n\t\tresult = NULL;\n\tif (result == NULL)\n\t{\n\t\t/* default behavior: look it up in the catalogs */\n\t\tresult = get_rel_name(indexId);\n\t\tif (result == NULL)\n\t\t\telog(ERROR, \u0026quot;cache lookup failed for index %u\u0026quot;, indexId);\u003c/pre\u003e","facts":[{"label":"Interface type","value":"explain_get_index_name_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":["src/backend/commands/explain.c:4027"],"title":"Call sites"},{"code":"static const char *\nexplain_get_index_name(Oid indexId)\n{\n\tconst char *result;\n\n\tif (explain_get_index_name_hook)\n\t\tresult = (*explain_get_index_name_hook) (indexId);\n\telse\n\t\tresult = NULL;\n\tif (result == NULL)\n\t{\n\t\t/* default behavior: look it up in the catalogs */\n\t\tresult = get_rel_name(indexId);\n\t\tif (result == NULL)\n\t\t\telog(ERROR, \"cache lookup failed for index %u\", indexId);","paragraphs":[],"title":"Core call context: src/backend/commands/explain.c:4021–4035"}],"signature":"typedef const char *(*explain_get_index_name_hook_type) (Oid indexId);\nextern PGDLLIMPORT explain_get_index_name_hook_type explain_get_index_name_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#L49"},{"label":"Core definition","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L53"},{"label":"Call sites","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L4027"}],"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#L49"},{"label":"Core definition","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L53"},{"label":"Call sites","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L4027"}],"kind":"authored-source-translation","locale":"zh-Hans","source_revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","translated_source_sha256":"515397122175fc1a1aa92a606fe1d5d2be3dde775aab99d45b2dc7a6a01dcf53","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#L49"},{"label":"Core definition","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L53"},{"label":"Call sites","path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/explain.c#L4027"}]},"MeasuredEvidence":{}},"Text":{"Collection":"hook","Key":"explain_get_index_name_hook","SourceDatabase":"center","Version":"18","Locale":"en","Title":"explain_get_index_name_hook","Summary":"Hook for plugins to get control in explain_get_index_name()","BodyHTML":"\u003cp\u003eHook for plugins to get control in explain_get_index_name()\u003c/p\u003e","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","ContentHash":"3987d2fe729adcdcb1176608ac45b156993d513328fa23b7306eb0a3fd8dc813","Payload":{"description":["Hook for plugins to get control in explain_get_index_name()"],"related":[{"label":"EXPLAIN","url":"/wiki/sql/explain/?v=18"}],"sections":[{"paragraphs":["src/backend/commands/explain.c:4027"],"title":"Call sites"},{"code":"static const char *\nexplain_get_index_name(Oid indexId)\n{\n\tconst char *result;\n\n\tif (explain_get_index_name_hook)\n\t\tresult = (*explain_get_index_name_hook) (indexId);\n\telse\n\t\tresult = NULL;\n\tif (result == NULL)\n\t{\n\t\t/* default behavior: look it up in the catalogs */\n\t\tresult = get_rel_name(indexId);\n\t\tif (result == NULL)\n\t\t\telog(ERROR, \"cache lookup failed for index %u\", indexId);","paragraphs":[],"title":"Core call context: src/backend/commands/explain.c:4021–4035"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
