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