PostgreSQL 中文参考文档
🌐 英文原版 官方 ↗

52.53. pg_statistic_ext_data #

目录 pg_statistic_ext_data 保存 pg_statistic_ext 中定义的扩展规划器统计信息的数据。 此目录中的每一行对应一个通过 CREATE STATISTICS 创建的统计对象。

通常,每个被分析过的统计对象有一个 stxdinherit = false 的条目。 如果该表有继承子表或分区,则还会创建一个 stxdinherit = true 的第二个条目。该行表示该统计对象在整个继承树上的统计信息, 即 SELECT * FROM table* 所看到的数据的统计信息, 而 stxdinherit = false 的行表示 SELECT * FROM ONLY table 的结果。

与 pg_statistic 一样,pg_statistic_ext_data 不应被公众读取, 因为其内容可能被视为敏感信息。 (例如:各列中最常见的值组合可能相当引人关注。) pg_stats_ext 是 pg_statistic_ext_data 上一个公开可读的视图 (在与 pg_statistic_ext 连接之后),它只暴露当前用户拥有的表的信息。

Table 52.53. \1 字段列说明

Column Type

Description

stxoid oid (references pg_statistic_ext.oid)

包含此数据定义的扩展统计对象

stxdinherit bool

如果为真,统计信息包括来自子表的值,而不只是指定关系中的值

stxdndistinct pg_ndistinct

以 pg_ndistinct 类型序列化的 N-distinct 计数

stxddependencies pg_dependencies

以 pg_dependencies 类型序列化的函数依赖统计信息

stxdmcv pg_mcv_list

最常见值(MCV)列表统计信息,序列化为 pg_mcv_list 类型

stxdexpr pg_statistic[]

每个表达式的统计信息,序列化为 pg_statistic 类型的数组