pg_statistic_ext_data 是一个 系统目录 表,其中包含在 pg_statistic_ext 中定义的扩展规划器统计数据。
pg_statistic_ext_data 在 PostgreSQL 12 中添加。
按 PostgreSQL 版本定义
pg_statistic_ext_data (PostgreSQL 19)
Table "pg_catalog.pg_statistic_ext_data"
Column | Type | Collation | Nullable | Default
------------------+-----------------+-----------+----------+---------
stxoid | oid | | not null |
stxdinherit | boolean | | not null |
stxdndistinct | pg_ndistinct | C | |
stxddependencies | pg_dependencies | C | |
stxdmcv | pg_mcv_list | C | |
stxdexpr | pg_statistic[] | | |
Indexes:
"pg_statistic_ext_data_stxoid_inh_index" PRIMARY KEY, btree (stxoid, stxdinherit)
pg_statistic_ext_data (PostgreSQL 18)
Table "pg_catalog.pg_statistic_ext_data"
Column | Type | Collation | Nullable | Default
------------------+-----------------+-----------+----------+---------
stxoid | oid | | not null |
stxdinherit | boolean | | not null |
stxdndistinct | pg_ndistinct | C | |
stxddependencies | pg_dependencies | C | |
stxdmcv | pg_mcv_list | C | |
stxdexpr | pg_statistic[] | | |
Indexes:
"pg_statistic_ext_data_stxoid_inh_index" PRIMARY KEY, btree (stxoid, stxdinherit)
pg_statistic_ext_data (PostgreSQL 17)
Table "pg_catalog.pg_statistic_ext_data"
Column | Type | Collation | Nullable | Default
------------------+-----------------+-----------+----------+---------
stxoid | oid | | not null |
stxdinherit | boolean | | not null |
stxdndistinct | pg_ndistinct | C | |
stxddependencies | pg_dependencies | C | |
stxdmcv | pg_mcv_list | C | |
stxdexpr | pg_statistic[] | | |
Indexes:
"pg_statistic_ext_data_stxoid_inh_index" PRIMARY KEY, btree (stxoid, stxdinherit)
pg_statistic_ext_data (PostgreSQL 16)
Table "pg_catalog.pg_statistic_ext_data"
Column | Type | Collation | Nullable | Default
------------------+-----------------+-----------+----------+---------
stxoid | oid | | not null |
stxdinherit | boolean | | not null |
stxdndistinct | pg_ndistinct | C | |
stxddependencies | pg_dependencies | C | |
stxdmcv | pg_mcv_list | C | |
stxdexpr | pg_statistic[] | | |
Indexes:
"pg_statistic_ext_data_stxoid_inh_index" PRIMARY KEY, btree (stxoid, stxdinherit)
pg_statistic_ext_data (PostgreSQL 15)
Table "pg_catalog.pg_statistic_ext_data"
Column | Type | Collation | Nullable | Default
------------------+-----------------+-----------+----------+---------
stxoid | oid | | not null |
stxdinherit | boolean | | not null |
stxdndistinct | pg_ndistinct | C | |
stxddependencies | pg_dependencies | C | |
stxdmcv | pg_mcv_list | C | |
stxdexpr | pg_statistic[] | | |
Indexes:
"pg_statistic_ext_data_stxoid_inh_index" PRIMARY KEY, btree (stxoid, stxdinherit)
pg_statistic_ext_data (PostgreSQL 14)
Table "pg_catalog.pg_statistic_ext_data"
Column | Type | Collation | Nullable | Default
------------------+-----------------+-----------+----------+---------
stxoid | oid | | not null |
stxdndistinct | pg_ndistinct | C | |
stxddependencies | pg_dependencies | C | |
stxdmcv | pg_mcv_list | C | |
stxdexpr | pg_statistic[] | | |
Indexes:
"pg_statistic_ext_data_stxoid_index" PRIMARY KEY, btree (stxoid)
pg_statistic_ext_data (PostgreSQL 13)
Table "pg_catalog.pg_statistic_ext_data"
Column | Type | Collation | Nullable | Default
------------------+-----------------+-----------+----------+---------
stxoid | oid | | not null |
stxdndistinct | pg_ndistinct | C | |
stxddependencies | pg_dependencies | C | |
stxdmcv | pg_mcv_list | C | |
Indexes:
"pg_statistic_ext_data_stxoid_index" UNIQUE, btree (stxoid)
pg_statistic_ext_data (PostgreSQL 12)
Table "pg_catalog.pg_statistic_ext_data"
Column | Type | Collation | Nullable | Default
------------------+-----------------+-----------+----------+---------
stxoid | oid | | not null |
stxdndistinct | pg_ndistinct | C | |
stxddependencies | pg_dependencies | C | |
stxdmcv | pg_mcv_list | C | |
Indexes:
"pg_statistic_ext_data_stxoid_index" UNIQUE, btree (stxoid)
变更历史
- PostgreSQL 15
- 添加了列
stxdinherit(提交 269b532a)
- 添加了列
- PostgreSQL 14
- 添加了列
stxdexpr(提交 a4d75c86)
- 添加了列
- PostgreSQL 12
- 添加 (提交 6cbfb784)
参考资料
- PostgreSQL 文档: pg_statistic_ext_data
