{"Entry":{"collection":"hook","key":"set_rel_pathlist_hook","name":"set_rel_pathlist_hook","aliases":[],"metadata":{"aliases":[],"category":"Query planning","content_hash":"f45e098d7bc0ff3b86847d5083bee675b8a9e0dbe644871ba054f56c18752ef3","imported_at":"2026-09-27T17:57:58.88876+08:00","name":"set_rel_pathlist_hook","name_zh":"set_rel_pathlist_hook","slug":"set_rel_pathlist_hook","summary":"Hook for plugins to get control in set_rel_pathlist()"}},"Definition":{"Collection":"hook","Key":"set_rel_pathlist_hook","SourceDatabase":"center","Version":"18","SourceTable":"hook","SourceKey":"set_rel_pathlist_hook","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","Facts":{"description":["Hook for plugins to get control in set_rel_pathlist()"],"facts":[{"label":"Interface type","value":"set_rel_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":["Allow a plugin to editorialize on the set of Paths for this base relation. It could add new paths (such as CustomPaths) by calling add_path(), or add_partial_path() if parallel aware. It could also delete or modify paths added by the core code."],"title":"Core source comments"},{"paragraphs":["src/backend/optimizer/path/allpaths.c:543"],"title":"Call sites"},{"code":"\t * Allow a plugin to editorialize on the set of Paths for this base\n\t * relation.  It could add new paths (such as CustomPaths) by calling\n\t * add_path(), or add_partial_path() if parallel aware.  It could also\n\t * delete or modify paths added by the core code.\n\t */\n\tif (set_rel_pathlist_hook)\n\t\t(*set_rel_pathlist_hook) (root, rel, rti, rte);\n\n\t/*\n\t * If this is a baserel, we should normally consider gathering any partial\n\t * paths we may have created for it.  We have to do this after calling the\n\t * set_rel_pathlist_hook, else it cannot add partial paths to be included\n\t * here.\n\t *\n\t * However, if this is an inheritance child, skip it.  Otherwise, we could","paragraphs":[],"title":"Core call context: src/backend/optimizer/path/allpaths.c:537–551"}],"signature":"typedef void (*set_rel_pathlist_hook_type) (PlannerInfo *root, RelOptInfo *rel, Index rti, RangeTblEntry *rte);\nextern PGDLLIMPORT set_rel_pathlist_hook_type set_rel_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#L30"},{"label":"Core definition","path":"src/backend/optimizer/path/allpaths.c","sha256":"285b61d146f1e7324a43d7d408ca8d6f10ad3de7eaba01c9f1d618417c21392d","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/optimizer/path/allpaths.c#L85"},{"label":"Call sites","path":"src/backend/optimizer/path/allpaths.c","sha256":"285b61d146f1e7324a43d7d408ca8d6f10ad3de7eaba01c9f1d618417c21392d","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/optimizer/path/allpaths.c#L543"}]},"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#L30"},{"label":"Core definition","path":"src/backend/optimizer/path/allpaths.c","sha256":"285b61d146f1e7324a43d7d408ca8d6f10ad3de7eaba01c9f1d618417c21392d","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/optimizer/path/allpaths.c#L85"},{"label":"Call sites","path":"src/backend/optimizer/path/allpaths.c","sha256":"285b61d146f1e7324a43d7d408ca8d6f10ad3de7eaba01c9f1d618417c21392d","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/optimizer/path/allpaths.c#L543"}]},"MeasuredEvidence":{}},"Text":{"Collection":"hook","Key":"set_rel_pathlist_hook","SourceDatabase":"center","Version":"18","Locale":"en","Title":"set_rel_pathlist_hook","Summary":"Hook for plugins to get control in set_rel_pathlist()","BodyHTML":"\u003cp\u003eHook for plugins to get control in set_rel_pathlist()\u003c/p\u003e","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","ContentHash":"5cc2dfcc06f451c97d65496ee0a095e028087aa489a9d7082526e996c961a437","Payload":{"description":["Hook for plugins to get control in set_rel_pathlist()"],"related":[{"label":"The Planner/Optimizer","url":"/docs/18/planner-optimizer.html"}],"sections":[{"paragraphs":["Allow a plugin to editorialize on the set of Paths for this base relation. It could add new paths (such as CustomPaths) by calling add_path(), or add_partial_path() if parallel aware. It could also delete or modify paths added by the core code."],"title":"Core source comments"},{"paragraphs":["src/backend/optimizer/path/allpaths.c:543"],"title":"Call sites"},{"code":"\t * Allow a plugin to editorialize on the set of Paths for this base\n\t * relation.  It could add new paths (such as CustomPaths) by calling\n\t * add_path(), or add_partial_path() if parallel aware.  It could also\n\t * delete or modify paths added by the core code.\n\t */\n\tif (set_rel_pathlist_hook)\n\t\t(*set_rel_pathlist_hook) (root, rel, rti, rte);\n\n\t/*\n\t * If this is a baserel, we should normally consider gathering any partial\n\t * paths we may have created for it.  We have to do this after calling the\n\t * set_rel_pathlist_hook, else it cannot add partial paths to be included\n\t * here.\n\t *\n\t * However, if this is an inheritance child, skip it.  Otherwise, we could","paragraphs":[],"title":"Core call context: src/backend/optimizer/path/allpaths.c:537–551"}]}},"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}
