pg_stats_ext_exprs

包含有关扩展统计对象中所有表达式的信息的系统视图

pg_stats_ext_exprs 是一个存储有关包含表达式的扩展统计对象的信息的系统目录视图。

pg_stats_ext_exprs 添加于PostgreSQL 14

按 PostgreSQL 版本定义

pg_stats_ext_exprs (PostgreSQL 17)

                View "pg_catalog.pg_stats_ext_exprs"
         Column         |   Type   | Collation | Nullable | Default 
------------------------+----------+-----------+----------+---------
 schemaname             | name     |           |          | 
 tablename              | name     |           |          | 
 statistics_schemaname  | name     |           |          | 
 statistics_name        | name     |           |          | 
 statistics_owner       | name     |           |          | 
 expr                   | text     |           |          | 
 inherited              | boolean  |           |          | 
 null_frac              | real     |           |          | 
 avg_width              | integer  |           |          | 
 n_distinct             | real     |           |          | 
 most_common_vals       | anyarray |           |          | 
 most_common_freqs      | real[]   |           |          | 
 histogram_bounds       | anyarray |           |          | 
 correlation            | real     |           |          | 
 most_common_elems      | anyarray |           |          | 
 most_common_elem_freqs | real[]   |           |          | 
 elem_count_histogram   | real[]   |           |          |
    

文档: pg_stats_ext_exprs

pg_stats_ext_exprs (PostgreSQL 16)

                View "pg_catalog.pg_stats_ext_exprs"
         Column         |   Type   | Collation | Nullable | Default 
------------------------+----------+-----------+----------+---------
 schemaname             | name     |           |          | 
 tablename              | name     |           |          | 
 statistics_schemaname  | name     |           |          | 
 statistics_name        | name     |           |          | 
 statistics_owner       | name     |           |          | 
 expr                   | text     |           |          | 
 inherited              | boolean  |           |          | 
 null_frac              | real     |           |          | 
 avg_width              | integer  |           |          | 
 n_distinct             | real     |           |          | 
 most_common_vals       | anyarray |           |          | 
 most_common_freqs      | real[]   |           |          | 
 histogram_bounds       | anyarray |           |          | 
 correlation            | real     |           |          | 
 most_common_elems      | anyarray |           |          | 
 most_common_elem_freqs | real[]   |           |          | 
 elem_count_histogram   | real[]   |           |          |
    

文档: pg_stats_ext_exprs

pg_stats_ext_exprs (PostgreSQL 15)

                View "pg_catalog.pg_stats_ext_exprs"
         Column         |   Type   | Collation | Nullable | Default 
------------------------+----------+-----------+----------+---------
 schemaname             | name     |           |          | 
 tablename              | name     |           |          | 
 statistics_schemaname  | name     |           |          | 
 statistics_name        | name     |           |          | 
 statistics_owner       | name     |           |          | 
 expr                   | text     |           |          | 
 inherited              | boolean  |           |          | 
 null_frac              | real     |           |          | 
 avg_width              | integer  |           |          | 
 n_distinct             | real     |           |          | 
 most_common_vals       | anyarray |           |          | 
 most_common_freqs      | real[]   |           |          | 
 histogram_bounds       | anyarray |           |          | 
 correlation            | real     |           |          | 
 most_common_elems      | anyarray |           |          | 
 most_common_elem_freqs | real[]   |           |          | 
 elem_count_histogram   | real[]   |           |          |
    

文档: pg_stats_ext_exprs

pg_stats_ext_exprs (PostgreSQL 14)

                View "pg_catalog.pg_stats_ext_exprs"
         Column         |   Type   | Collation | Nullable | Default 
------------------------+----------+-----------+----------+---------
 schemaname             | name     |           |          | 
 tablename              | name     |           |          | 
 statistics_schemaname  | name     |           |          | 
 statistics_name        | name     |           |          | 
 statistics_owner       | name     |           |          | 
 expr                   | text     |           |          | 
 null_frac              | real     |           |          | 
 avg_width              | integer  |           |          | 
 n_distinct             | real     |           |          | 
 most_common_vals       | anyarray |           |          | 
 most_common_freqs      | real[]   |           |          | 
 histogram_bounds       | anyarray |           |          | 
 correlation            | real     |           |          | 
 most_common_elems      | anyarray |           |          | 
 most_common_elem_freqs | real[]   |           |          | 
 elem_count_histogram   | real[]   |           |          |
    

文档: pg_stats_ext_exprs

更改历史记录

示例

pg_stats_ext_exprs 的基本用法示例

postgres=# CREATE TABLE foo (id int);
CREATE TABLE

postgres=# INSERT INTO foo values(generate_series(1,10000));
INSERT 0 10000

postgres=# CREATE STATISTICS s ON mod(id,5) FROM foo;
CREATE STATISTICS

postgres=# ANALYZE foo;
ANALYZE

postgres=# SELECT * FROM pg_stats_ext_exprs;
-[ RECORD 1 ]----------+----------------------
schemaname             | public
tablename              | foo
statistics_schemaname  | public
statistics_name        | s
statistics_owner       | postgres
expr                   | mod(id, 5)
null_frac              | 0
avg_width              | 4
n_distinct             | 5
most_common_vals       | {0,1,2,3,4}
most_common_freqs      | {0.2,0.2,0.2,0.2,0.2}
histogram_bounds       | 
correlation            | 0.19999996
most_common_elems      | 
most_common_elem_freqs | 
elem_count_histogram   | 

分类

系统目录

另请参阅

pg_stats_extpg_stats

反馈

提交您对 "pg_stats_ext_exprs" 的任何评论、建议或更正 此处