{"Entry":{"collection":"hook","key":"set_join_pathlist_hook","name":"set_join_pathlist_hook","aliases":[],"metadata":{"aliases":[],"category":"Query planning","content_hash":"7e4c49ea976a416e09eb6e8fef1fac0ffa4192068e77e6acbad3871417f5a432","derived_content_hash":"6b8b72d830e7479ee9296dab195258bc6edfd909a12081a200654c46659eac8c","imported_at":"2026-09-27T17:57:58.886396+08:00","name":"set_join_pathlist_hook","name_zh":"set_join_pathlist_hook","repair_provenance":{"original_source_revision":"","receipt_sha256":"a11b0b961d5c1101995037152d53bb1131ba5809d7950fcae6c74bf7e8f93539","repair":"wiki-repair-20261023"},"slug":"set_join_pathlist_hook","source_rev":"wiki-repair-20261023:61147d17f78521f2483674fd8fd1553033a5956a00776d885a33f6e2279ac980","summary":"Hook for plugins to get control in add_paths_to_joinrel()"}},"Definition":{"Collection":"hook","Key":"set_join_pathlist_hook","SourceDatabase":"center","Version":"18","SourceTable":"hook","SourceKey":"set_join_pathlist_hook","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","Facts":{"description":["Hook for plugins to get control in add_paths_to_joinrel()"],"description_zh":"供插件在 add_paths_to_joinrel() 中接管处理的钩子。","description_zh_html":"\u003cp\u003e供插件在 add_paths_to_joinrel() 中接管处理的钩子。\u003c/p\u003e\u003cp\u003e以下中文为本站依据所列 PostgreSQL 源码注释编译的说明。\u003c/p\u003e\u003ch3\u003e接口声明\u003c/h3\u003e\u003cpre\u003etypedef void (*set_join_pathlist_hook_type) (PlannerInfo *root, RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel, JoinType jointype, JoinPathExtraData *extra);\nextern PGDLLIMPORT set_join_pathlist_hook_type set_join_pathlist_hook;\u003c/pre\u003e\u003ch3\u003e源码说明\u003c/h3\u003e\u003cp\u003e6. 最后，允许扩展调整路径列表。扩展可调用 add_path() 添加新路径（例如 CustomPaths）；若支持并行，则可调用 add_partial_path()。也可以删除或修改核心代码添加的路径。\u003c/p\u003e\u003ch3\u003e调用位置\u003c/h3\u003e\u003cul\u003e\u003cli\u003e\u003ccode\u003esrc/backend/optimizer/path/joinpath.c:343\u003c/code\u003e\u003c/li\u003e\u003c/ul\u003e\u003ch3\u003e核心调用上下文：src/backend/optimizer/path/joinpath.c:337–351\u003c/h3\u003e\u003cpre\u003e\t * 6. Finally, give extensions a chance to manipulate the path list.  They\n\t * could add new paths (such as CustomPaths) by calling add_path(), or\n\t * add_partial_path() if parallel aware.  They could also delete or modify\n\t * paths added by the core code.\n\t */\n\tif (set_join_pathlist_hook)\n\t\tset_join_pathlist_hook(root, joinrel, outerrel, innerrel,\n\t\t\t\t\t\t\t   jointype, \u0026amp;extra);\n}\n\n/*\n * We override the param_source_rels heuristic to accept nestloop paths in\n * which the outer rel satisfies some but not all of the inner path\u0026#x27;s\n * parameterization.  This is necessary to get good plans for star-schema\n * scenarios, in which a parameterized path for a large table may require\u003c/pre\u003e","facts":[{"label":"Interface type","value":"set_join_pathlist_hook_type"},{"label":"Header","value":"src/include/optimizer/paths.h"},{"label":"Subsystem","value":"Query planning"},{"label":"Initial value","value":"NULL (no hook installed)"}],"related":[{"label":"The Planner/Optimizer","url":"/docs/18/planner-optimizer.html"}],"release":{"channel":"stable","label":"18","major":"18","ref":"REL_18_STABLE","revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd"},"sections":[{"paragraphs":["6. Finally, give extensions a chance to manipulate the path list. They could add new paths (such as CustomPaths) by calling add_path(), or add_partial_path() if parallel aware. They could also delete or modify paths added by the core code."],"title":"Core source comments"},{"paragraphs":["src/backend/optimizer/path/joinpath.c:343"],"title":"Call sites"},{"code":"\t * 6. Finally, give extensions a chance to manipulate the path list.  They\n\t * could add new paths (such as CustomPaths) by calling add_path(), or\n\t * add_partial_path() if parallel aware.  They could also delete or modify\n\t * paths added by the core code.\n\t */\n\tif (set_join_pathlist_hook)\n\t\tset_join_pathlist_hook(root, joinrel, outerrel, innerrel,\n\t\t\t\t\t\t\t   jointype, \u0026extra);\n}\n\n/*\n * We override the param_source_rels heuristic to accept nestloop paths in\n * which the outer rel satisfies some but not all of the inner path's\n * parameterization.  This is necessary to get good plans for star-schema\n * scenarios, in which a parameterized path for a large table may require","paragraphs":[],"title":"Core call context: src/backend/optimizer/path/joinpath.c:337–351"}],"signature":"typedef void (*set_join_pathlist_hook_type) (PlannerInfo *root, RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel, JoinType jointype, JoinPathExtraData *extra);\nextern PGDLLIMPORT set_join_pathlist_hook_type set_join_pathlist_hook;","sources":[{"label":"Interface declaration","path":"src/include/optimizer/paths.h","sha256":"bf497b2e5501e7c86250147c9cc779785ccec7bb2a806d3c71571313e890208f","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/optimizer/paths.h#L37"},{"label":"Core definition","path":"src/backend/optimizer/path/joinpath.c","sha256":"03bf45577e4b5c70a6d9e9d2a0bb595846b0bedd7dde4ad4e7a48e5bc308e4c8","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/optimizer/path/joinpath.c#L33"},{"label":"Call sites","path":"src/backend/optimizer/path/joinpath.c","sha256":"03bf45577e4b5c70a6d9e9d2a0bb595846b0bedd7dde4ad4e7a48e5bc308e4c8","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/optimizer/path/joinpath.c#L343"}],"translation_provenance":{"inputs":[{"label":"Interface declaration","path":"src/include/optimizer/paths.h","sha256":"bf497b2e5501e7c86250147c9cc779785ccec7bb2a806d3c71571313e890208f","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/optimizer/paths.h#L37"},{"label":"Core definition","path":"src/backend/optimizer/path/joinpath.c","sha256":"03bf45577e4b5c70a6d9e9d2a0bb595846b0bedd7dde4ad4e7a48e5bc308e4c8","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/optimizer/path/joinpath.c#L33"},{"label":"Call sites","path":"src/backend/optimizer/path/joinpath.c","sha256":"03bf45577e4b5c70a6d9e9d2a0bb595846b0bedd7dde4ad4e7a48e5bc308e4c8","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/optimizer/path/joinpath.c#L343"}],"kind":"authored-source-translation","locale":"zh-Hans","source_revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","translated_source_sha256":"d17cac637a6e5f37f9300f8a4c6ee52bb399fcc619860171dd328d603a978626","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/optimizer/paths.h","sha256":"bf497b2e5501e7c86250147c9cc779785ccec7bb2a806d3c71571313e890208f","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/optimizer/paths.h#L37"},{"label":"Core definition","path":"src/backend/optimizer/path/joinpath.c","sha256":"03bf45577e4b5c70a6d9e9d2a0bb595846b0bedd7dde4ad4e7a48e5bc308e4c8","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/optimizer/path/joinpath.c#L33"},{"label":"Call sites","path":"src/backend/optimizer/path/joinpath.c","sha256":"03bf45577e4b5c70a6d9e9d2a0bb595846b0bedd7dde4ad4e7a48e5bc308e4c8","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/optimizer/path/joinpath.c#L343"}]},"MeasuredEvidence":{}},"Text":{"Collection":"hook","Key":"set_join_pathlist_hook","SourceDatabase":"center","Version":"18","Locale":"en","Title":"set_join_pathlist_hook","Summary":"Hook for plugins to get control in add_paths_to_joinrel()","BodyHTML":"\u003cp\u003eHook for plugins to get control in add_paths_to_joinrel()\u003c/p\u003e","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","ContentHash":"910dfe70f08824386ba2ec628da79bf11c1b7ef5d367a065aa92e1a23fc51cfd","Payload":{"description":["Hook for plugins to get control in add_paths_to_joinrel()"],"related":[{"label":"The Planner/Optimizer","url":"/docs/18/planner-optimizer.html"}],"sections":[{"paragraphs":["6. Finally, give extensions a chance to manipulate the path list. They could add new paths (such as CustomPaths) by calling add_path(), or add_partial_path() if parallel aware. They could also delete or modify paths added by the core code."],"title":"Core source comments"},{"paragraphs":["src/backend/optimizer/path/joinpath.c:343"],"title":"Call sites"},{"code":"\t * 6. Finally, give extensions a chance to manipulate the path list.  They\n\t * could add new paths (such as CustomPaths) by calling add_path(), or\n\t * add_partial_path() if parallel aware.  They could also delete or modify\n\t * paths added by the core code.\n\t */\n\tif (set_join_pathlist_hook)\n\t\tset_join_pathlist_hook(root, joinrel, outerrel, innerrel,\n\t\t\t\t\t\t\t   jointype, \u0026extra);\n}\n\n/*\n * We override the param_source_rels heuristic to accept nestloop paths in\n * which the outer rel satisfies some but not all of the inner path's\n * parameterization.  This is necessary to get good plans for star-schema\n * scenarios, in which a parameterized path for a large table may require","paragraphs":[],"title":"Core call context: src/backend/optimizer/path/joinpath.c:337–351"}]}},"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}
