set_rel_pathlist_hook
关系访问路径
供插件在 set_rel_pathlist() 中接管处理的钩子。
当前查看 PostgreSQL 18。
中文定义与说明
供插件在 set_rel_pathlist() 中接管处理的钩子。
以下中文为本站依据所列 PostgreSQL 源码注释编译的说明。
接口声明
typedef void (*set_rel_pathlist_hook_type) (PlannerInfo *root, RelOptInfo *rel, Index rti, RangeTblEntry *rte); extern PGDLLIMPORT set_rel_pathlist_hook_type set_rel_pathlist_hook;
源码说明
允许插件调整此基表关系的路径集合。插件可调用 add_path() 添加新路径(例如 CustomPaths);若支持并行,则可调用 add_partial_path()。也可以删除或修改核心代码添加的路径。
调用位置
src/backend/optimizer/path/allpaths.c:543
核心调用上下文:src/backend/optimizer/path/allpaths.c:537–551
* 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. */ if (set_rel_pathlist_hook) (*set_rel_pathlist_hook) (root, rel, rti, rte); /* * If this is a baserel, we should normally consider gathering any partial * paths we may have created for it. We have to do this after calling the * set_rel_pathlist_hook, else it cannot add partial paths to be included * here. * * However, if this is an inheritance child, skip it. Otherwise, we could
说明
供插件在 set_rel_pathlist() 中接管处理的钩子。
- 接口类型
- set_rel_pathlist_hook_type
- 声明头文件
- src/include/optimizer/paths.h
- 调用阶段
- 查询规划
- 初始值
- NULL(未安装钩子)
接口签名
typedef void (*set_rel_pathlist_hook_type) (PlannerInfo *root, RelOptInfo *rel, Index rti, RangeTblEntry *rte);
extern PGDLLIMPORT set_rel_pathlist_hook_type set_rel_pathlist_hook;调用位置
src/backend/optimizer/path/allpaths.c:543
相关条目
文档与源码
查看来源构建
- 版本
- 18
- 构建
- REL_18_STABLE
- 来源指纹
753057e340da8f22e57c9a409ea7a235fd6a46bd
同类条目
create_upper_paths_hook上层查询路径get_relation_info_hook关系规划信息join_search_hook连接顺序搜索planner_hook查询规划入口set_join_pathlist_hook连接访问路径
返回扩展钩子 · 此条目的收录范围为 PostgreSQL 10 至 20;起点不一定是实际引入版本。