get_relation_stats_hook
表列统计信息
为选择率估算提供表列统计信息。
当前查看 PostgreSQL 18。
说明
选择率估算器读取关系属性的统计信息时可调用此钩子。钩子接收规划上下文、范围表条目、属性号和 VariableStatData;返回值说明扩展是否接管了此次统计信息获取。
- 接口类型
- get_relation_stats_hook_type
- 声明头文件
- src/include/utils/selfuncs.h
- 调用阶段
- 统计信息与估算
- 初始值
- NULL(未安装钩子)
接口签名
typedef bool (*get_relation_stats_hook_type) (PlannerInfo *root, RangeTblEntry *rte, AttrNumber attnum, VariableStatData *vardata);
extern PGDLLIMPORT get_relation_stats_hook_type get_relation_stats_hook;调用位置
src/backend/utils/adt/selfuncs.c:5717
src/backend/utils/adt/selfuncs.c:6198
src/backend/utils/adt/selfuncs.c:8752
相关条目
文档与源码
查看来源构建
- 版本
- 18
- 构建
- REL_18_STABLE
- 来源指纹
753057e340da8f22e57c9a409ea7a235fd6a46bd
同类条目
get_attavgwidth_hook平均属性宽度get_index_stats_hook索引表达式统计信息
返回扩展钩子 · 此条目的收录范围为 PostgreSQL 10 至 20;起点不一定是实际引入版本。