{"Entry":{"collection":"catalog","key":"pg_stats_ext_exprs","name":"pg_stats_ext_exprs","aliases":[],"metadata":{"changed_in":["15","19"],"changes":[{"added":[],"attributes":[],"description_changed":false,"descriptions":[],"from":"13","order":false,"removed":[],"status":"added","to":"14","types":[]},{"added":["inherited"],"attributes":[],"description_changed":false,"descriptions":[],"from":"14","listing":[],"order":false,"removed":[],"status":"changed","to":"15","types":[],"unlisted":[]},{"added":["tableid","statistics_id","range_length_histogram","range_empty_frac","range_bounds_histogram"],"attributes":[],"description_changed":false,"descriptions":[],"from":"18","listing":[],"order":false,"removed":[],"status":"changed","to":"19","types":[],"unlisted":[]}],"column_count":22,"content_hash":"9247e1183fcd58e85ad42241e69c94c8ef21fa7e30feb17fc3ea6562dd7e3872","first_version":"14","imported_at":"2026-09-30T00:40:56.228725+08:00","kind":"view","last_version":"20","name":"pg_stats_ext_exprs","position":135,"present_in":["14","15","16","17","18","19","20"],"relation_oid":null,"relkind":"v","shared":false,"source_rev":"english-manuals:05b629c1978f11f4b7e8c21a30849798216afb5231bbd59cc4e733eda3e77b1b","summary":"The view pg_stats_ext_exprs provides access to information about all expressions included in extended statistics objects, combining information stored in the pg_statistic_ext and pg_statistic_ext_data catalogs.","summary_zh":""}},"Definition":{"Collection":"catalog","Key":"pg_stats_ext_exprs","SourceDatabase":"center","Version":"18","SourceTable":"catalog","SourceKey":"pg_stats_ext_exprs","SourceRevision":"english-manuals:05b629c1978f11f4b7e8c21a30849798216afb5231bbd59cc4e733eda3e77b1b","Facts":{"columns":[{"array_dimensions":0,"attnum":1,"description":"Name of schema containing table","description_zh":"","documented":true,"documented_name":"schemaname","hidden":false,"name":"schemaname","not_null":false,"references":"pg_namespace.nspname","type":"name","type_modifier":-1,"type_oid":19},{"array_dimensions":0,"attnum":2,"description":"Name of table the statistics object is defined on","description_zh":"","documented":true,"documented_name":"tablename","hidden":false,"name":"tablename","not_null":false,"references":"pg_class.relname","type":"name","type_modifier":-1,"type_oid":19},{"array_dimensions":0,"attnum":3,"description":"Name of schema containing extended statistics object","description_zh":"","documented":true,"documented_name":"statistics_schemaname","hidden":false,"name":"statistics_schemaname","not_null":false,"references":"pg_namespace.nspname","type":"name","type_modifier":-1,"type_oid":19},{"array_dimensions":0,"attnum":4,"description":"Name of extended statistics object","description_zh":"","documented":true,"documented_name":"statistics_name","hidden":false,"name":"statistics_name","not_null":false,"references":"pg_statistic_ext.stxname","type":"name","type_modifier":-1,"type_oid":19},{"array_dimensions":0,"attnum":5,"description":"Owner of the extended statistics object","description_zh":"","documented":true,"documented_name":"statistics_owner","hidden":false,"name":"statistics_owner","not_null":false,"references":"pg_authid.rolname","type":"name","type_modifier":-1,"type_oid":19},{"array_dimensions":0,"attnum":6,"description":"Expression included in the extended statistics object","description_zh":"","documented":true,"documented_name":"expr","hidden":false,"name":"expr","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":7,"description":"If true, the stats include values from child tables, not just the values in the specified relation","description_zh":"","documented":true,"documented_name":"inherited","hidden":false,"name":"inherited","not_null":false,"references":"pg_statistic_ext_data.stxdinherit","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":8,"description":"Fraction of expression entries that are null","description_zh":"","documented":true,"documented_name":"null_frac","hidden":false,"name":"null_frac","not_null":false,"references":"","type":"float4","type_modifier":-1,"type_oid":700},{"array_dimensions":0,"attnum":9,"description":"Average width in bytes of expression's entries","description_zh":"","documented":true,"documented_name":"avg_width","hidden":false,"name":"avg_width","not_null":false,"references":"","type":"int4","type_modifier":-1,"type_oid":23},{"array_dimensions":0,"attnum":10,"description":"If greater than zero, the estimated number of distinct values in the expression. If less than zero, the negative of the number of distinct values divided by the number of rows. (The negated form is used when ANALYZE believes that the number of distinct values is likely to increase as the table grows; the positive form is used when the expression seems to have a fixed number of possible values.) For example, -1 indicates a unique expression in which the number of distinct values is the same as the number of rows.","description_zh":"","documented":true,"documented_name":"n_distinct","hidden":false,"name":"n_distinct","not_null":false,"references":"","type":"float4","type_modifier":-1,"type_oid":700},{"array_dimensions":0,"attnum":11,"description":"A list of the most common values in the expression. (Null if no values seem to be more common than any others.)","description_zh":"","documented":true,"documented_name":"most_common_vals","hidden":false,"name":"most_common_vals","not_null":false,"references":"","type":"anyarray","type_modifier":-1,"type_oid":2277},{"array_dimensions":0,"attnum":12,"description":"A list of the frequencies of the most common values, i.e., number of occurrences of each divided by total number of rows. (Null when most_common_vals is.)","description_zh":"","documented":true,"documented_name":"most_common_freqs","hidden":false,"name":"most_common_freqs","not_null":false,"references":"","type":"float4[]","type_modifier":-1,"type_oid":1021},{"array_dimensions":0,"attnum":13,"description":"A list of values that divide the expression's values into groups of approximately equal population. The values in most_common_vals, if present, are omitted from this histogram calculation. (This expression is null if the expression data type does not have a \u003c operator or if the most_common_vals list accounts for the entire population.)","description_zh":"","documented":true,"documented_name":"histogram_bounds","hidden":false,"name":"histogram_bounds","not_null":false,"references":"","type":"anyarray","type_modifier":-1,"type_oid":2277},{"array_dimensions":0,"attnum":14,"description":"Statistical correlation between physical row ordering and logical ordering of the expression values. This ranges from -1 to +1. When the value is near -1 or +1, an index scan on the expression will be estimated to be cheaper than when it is near zero, due to reduction of random access to the disk. (This expression is null if the expression's data type does not have a \u003c operator.)","description_zh":"","documented":true,"documented_name":"correlation","hidden":false,"name":"correlation","not_null":false,"references":"","type":"float4","type_modifier":-1,"type_oid":700},{"array_dimensions":0,"attnum":15,"description":"A list of non-null element values most often appearing within values of the expression. (Null for scalar types.)","description_zh":"","documented":true,"documented_name":"most_common_elems","hidden":false,"name":"most_common_elems","not_null":false,"references":"","type":"anyarray","type_modifier":-1,"type_oid":2277},{"array_dimensions":0,"attnum":16,"description":"A list of the frequencies of the most common element values, i.e., the fraction of rows containing at least one instance of the given value. Two or three additional values follow the per-element frequencies; these are the minimum and maximum of the preceding per-element frequencies, and optionally the frequency of null elements. (Null when most_common_elems is.)","description_zh":"","documented":true,"documented_name":"most_common_elem_freqs","hidden":false,"name":"most_common_elem_freqs","not_null":false,"references":"","type":"float4[]","type_modifier":-1,"type_oid":1021},{"array_dimensions":0,"attnum":17,"description":"A histogram of the counts of distinct non-null element values within the values of the expression, followed by the average number of distinct non-null elements. (Null for scalar types.)","description_zh":"","documented":true,"documented_name":"elem_count_histogram","hidden":false,"name":"elem_count_histogram","not_null":false,"references":"","type":"float4[]","type_modifier":-1,"type_oid":1021}],"description":"The view pg_stats_ext_exprs provides access to information about all expressions included in extended statistics objects, combining information stored in the pg_statistic_ext and pg_statistic_ext_data catalogs. This view allows access only to rows of pg_statistic_ext and pg_statistic_ext_data that correspond to tables the user owns, and therefore it is safe to allow public read access to this view.\n\npg_stats_ext_exprs is also designed to present the information in a more readable format than the underlying catalogs — at the cost that its schema must be extended whenever the structure of statistics in pg_statistic_ext changes.","description_zh":"","doc":{"anchor":"id-1.10.5.35.5","file":"view-pg-stats-ext-exprs.html","lang":"en","sha256":"d7bc32df65c8164dec780f0896751fc2e4edefad3bff3f56abd94f5e3ecd773b","slug":"18"},"kind":"view","lang":"en","measured_attributes":true,"metadata_release":"18.6","runtime_columns":["schemaname","tablename","statistics_schemaname","statistics_name","statistics_owner","expr","inherited","null_frac","avg_width","n_distinct","most_common_vals","most_common_freqs","histogram_bounds","correlation","most_common_elems","most_common_elem_freqs","elem_count_histogram"],"runtime_verified":false,"source":"english-manual"},"ManualEvidence":{"doc":{"anchor":"id-1.10.5.35.5","file":"view-pg-stats-ext-exprs.html","lang":"en","sha256":"d7bc32df65c8164dec780f0896751fc2e4edefad3bff3f56abd94f5e3ecd773b","slug":"18"}},"MeasuredEvidence":{"measured_attributes":true,"metadata_release":"18.6","runtime_columns":["schemaname","tablename","statistics_schemaname","statistics_name","statistics_owner","expr","inherited","null_frac","avg_width","n_distinct","most_common_vals","most_common_freqs","histogram_bounds","correlation","most_common_elems","most_common_elem_freqs","elem_count_histogram"],"runtime_verified":false}},"Text":{"Collection":"catalog","Key":"pg_stats_ext_exprs","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_stats_ext_exprs","Summary":"视图pg_stats_ext_exprs提供对扩展统计对象中包含的所有表达式信息的访问，结合存储在pg_statistic_ext 和pg_statistic_ext_data 目录中的信息。此视图仅允许访问与用户拥有的表相对应的 pg_statistic_ext和pg_statistic_ext_data 行，因此可以安全地允许对此视图进行公共读访问。\n\npg_stats_ext_exprs也旨在以比底层目录更易读的格式呈现信息— 但其模式必须在pg_statistic_ext中的统计结构更改时进行扩展。","BodyHTML":"\u003cp\u003e视图pg_stats_ext_exprs提供对扩展统计对象中包含的所有表达式信息的访问，结合存储在pg_statistic_ext 和pg_statistic_ext_data 目录中的信息。此视图仅允许访问与用户拥有的表相对应的 pg_statistic_ext和pg_statistic_ext_data 行，因此可以安全地允许对此视图进行公共读访问。\n\npg_stats_ext_exprs也旨在以比底层目录更易读的格式呈现信息— 但其模式必须在pg_statistic_ext中的统计结构更改时进行扩展。\u003c/p\u003e","SourceRevision":"2026-09-27@419045e","ContentHash":"cb0d049ff7cf1a28ebac797f6fbccd0147ca543ad93447a02aa18e7501615028","Payload":{"columns":[{"description_zh":"包含表的模式名称","name":"schemaname","type":"name","zh_from":"doc"},{"description_zh":"统计信息对象所定义于的表的名称","name":"tablename","type":"name","zh_from":"doc"},{"description_zh":"包含扩展统计信息对象的模式名","name":"statistics_schemaname","type":"name","zh_from":"doc"},{"description_zh":"扩展统计信息对象的名称","name":"statistics_name","type":"name","zh_from":"doc"},{"description_zh":"扩展统计信息对象的所有者","name":"statistics_owner","type":"name","zh_from":"doc"},{"description_zh":"扩展统计信息对象中包含的表达式","name":"expr","type":"text","zh_from":"doc"},{"description_zh":"如果为真，则统计信息包括子表中的值，而不仅仅是指定关系中的值","name":"inherited","type":"boolean","zh_from":"doc"},{"description_zh":"表达式条目为 NULL 的比例","name":"null_frac","type":"real","zh_from":"doc"},{"description_zh":"表达式条目的平均宽度，以字节表示","name":"avg_width","type":"integer","zh_from":"doc"},{"description_zh":"如果大于零，表示表达式中不同值的估计个数。如果小于零，是不同值个数除以行数的负值（当ANALYZE认为不同值的数量会随着表增长而增加时采用负值的形式，而如果认为表达式具有固定数量的可能值时采用正值的形式）。例如，-1表示一个唯一表达式，即其中不同值的个数等于行数。","name":"n_distinct","type":"real","zh_from":"doc"},{"description_zh":"表达式中高频值的列表（如果没有任何值看起来比其他值更常见，则为 NULL）。","name":"most_common_vals","type":"anyarray","zh_from":"doc"},{"description_zh":"高频值的频率列表，即每一个高频值的出现次数除以总行数（如果most_common_vals为 NULL，则此列为 NULL）","name":"most_common_freqs","type":"real[]","zh_from":"doc"},{"description_zh":"用于将表达式的值划分为若干组的值列表，各组所含值的数量近似相等。如果存在most_common_vals，其中的值会被直方图计算所忽略（如果表达式的数据类型没有一个\u003c操作符或者most_common_vals列表覆盖了全部值，则此列为 NULL）","name":"histogram_bounds","type":"anyarray","zh_from":"doc"},{"description_zh":"物理行顺序和表达式值逻辑顺序之间的统计相关性。其范围从-1到+1。当值接近-1或+1时，在表达式上的一个索引扫描被估计为比值接近0时的代价更低，因为这种情况减少了对磁盘的随机访问（如果表达式的数据类型不具有一个\u003c操作符，则此列为 NULL）","name":"correlation","type":"real","zh_from":"doc"},{"description_zh":"表达式值内最常出现的非 NULL 元素值的列表（对于标量类型为 NULL）。","name":"most_common_elems","type":"anyarray","zh_from":"doc"},{"description_zh":"高频元素值的频率列表，即至少包含一次给定值的行所占的比例。所有逐元素频率之后还有两个或三个附加值：前述逐元素频率的最小值和最大值，以及可选的 NULL 元素频率（当 most_common_elems 为 NULL 时，此列为 NULL）。","name":"most_common_elem_freqs","type":"real[]","zh_from":"doc"},{"description_zh":"各表达式值中不同非 NULL 元素的数量的直方图，后面跟随该数量的平均值（对于标量类型为 NULL）。","name":"elem_count_histogram","type":"real[]","zh_from":"doc"}],"description_zh":"视图pg_stats_ext_exprs提供对扩展统计对象中包含的所有表达式信息的访问，结合存储在pg_statistic_ext 和pg_statistic_ext_data 目录中的信息。此视图仅允许访问与用户拥有的表相对应的 pg_statistic_ext和pg_statistic_ext_data 行，因此可以安全地允许对此视图进行公共读访问。\n\npg_stats_ext_exprs也旨在以比底层目录更易读的格式呈现信息— 但其模式必须在pg_statistic_ext中的统计结构更改时进行扩展。","zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
