↑↓ 选择 ↵ 打开 ⌫ 改范围 完整检索页

pgsql.cc 提供对 postgresql.org 官网内容的中文翻译,由 Pigsty 团队维护。

百科 / 扩展钩子 / 查询规划

join_search_hook

连接顺序搜索

供插件替换 standard_join_search() 的钩子。

当前查看 PostgreSQL 18。

中文定义与说明

供插件替换 standard_join_search() 的钩子。

以下中文为本站依据所列 PostgreSQL 源码注释编译的说明。

接口声明

typedef RelOptInfo *(*join_search_hook_type) (PlannerInfo *root, int levels_needed, List *initial_rels);
extern PGDLLIMPORT join_search_hook_type join_search_hook;

调用位置

  • src/backend/optimizer/path/allpaths.c:3423

核心调用上下文:src/backend/optimizer/path/allpaths.c:3417–3431

		 * We put the initial_rels list into a PlannerInfo field because
		 * has_legal_joinclause() needs to look at it (ugly :-().
		 */
		root->initial_rels = initial_rels;

		if (join_search_hook)
			return (*join_search_hook) (root, levels_needed, initial_rels);
		else if (enable_geqo && levels_needed >= geqo_threshold)
			return geqo(root, levels_needed, initial_rels);
		else
			return standard_join_search(root, levels_needed, initial_rels);
	}
}

/*

说明

供插件替换 standard_join_search() 的钩子。

接口类型
join_search_hook_type
声明头文件
src/include/optimizer/paths.h
调用阶段
查询规划
初始值
NULL(未安装钩子)

接口签名

typedef RelOptInfo *(*join_search_hook_type) (PlannerInfo *root, int levels_needed, List *initial_rels);
extern PGDLLIMPORT join_search_hook_type join_search_hook;

调用位置

src/backend/optimizer/path/allpaths.c:3423

相关条目

文档与源码

查看来源构建
版本
18
构建
REL_18_STABLE
来源指纹
753057e340da8f22e57c9a409ea7a235fd6a46bd

同类条目

返回扩展钩子 · 此条目的收录范围为 PostgreSQL 10 至 20;起点不一定是实际引入版本。