pg_statistic_ext
是一个包含扩展规划器统计定义的系统目录表,由 CREATE STATISTICS
命令定义。
pg_statistic_ext
添加于 PostgreSQL 10。
按 PostgreSQL 版本定义
pg_statistic_ext (PostgreSQL 17)
Table "pg_catalog.pg_statistic_ext" Column | Type | Collation | Nullable | Default ---------------+--------------+-----------+----------+--------- oid | oid | | not null | stxrelid | oid | | not null | stxname | name | | not null | stxnamespace | oid | | not null | stxowner | oid | | not null | stxkeys | int2vector | | not null | stxstattarget | smallint | | | stxkind | "char"[] | | not null | stxexprs | pg_node_tree | C | | Indexes: "pg_statistic_ext_oid_index" PRIMARY KEY, btree (oid) "pg_statistic_ext_name_index" UNIQUE CONSTRAINT, btree (stxname, stxnamespace) "pg_statistic_ext_relid_index" btree (stxrelid)
文档: pg_statistic_ext
pg_statistic_ext (PostgreSQL 16)
Table "pg_catalog.pg_statistic_ext" Column | Type | Collation | Nullable | Default ---------------+--------------+-----------+----------+--------- oid | oid | | not null | stxrelid | oid | | not null | stxname | name | | not null | stxnamespace | oid | | not null | stxowner | oid | | not null | stxstattarget | integer | | not null | stxkeys | int2vector | | not null | stxkind | "char"[] | | not null | stxexprs | pg_node_tree | C | | Indexes: "pg_statistic_ext_oid_index" PRIMARY KEY, btree (oid) "pg_statistic_ext_name_index" UNIQUE CONSTRAINT, btree (stxname, stxnamespace) "pg_statistic_ext_relid_index" btree (stxrelid)
文档: pg_statistic_ext
pg_statistic_ext (PostgreSQL 15)
Table "pg_catalog.pg_statistic_ext" Column | Type | Collation | Nullable | Default ---------------+--------------+-----------+----------+--------- oid | oid | | not null | stxrelid | oid | | not null | stxname | name | | not null | stxnamespace | oid | | not null | stxowner | oid | | not null | stxstattarget | integer | | not null | stxkeys | int2vector | | not null | stxkind | "char"[] | | not null | stxexprs | pg_node_tree | C | | Indexes: "pg_statistic_ext_oid_index" PRIMARY KEY, btree (oid) "pg_statistic_ext_name_index" UNIQUE CONSTRAINT, btree (stxname, stxnamespace) "pg_statistic_ext_relid_index" btree (stxrelid)
文档: pg_statistic_ext
pg_statistic_ext (PostgreSQL 14)
Table "pg_catalog.pg_statistic_ext" Column | Type | Collation | Nullable | Default ---------------+--------------+-----------+----------+--------- oid | oid | | not null | stxrelid | oid | | not null | stxname | name | | not null | stxnamespace | oid | | not null | stxowner | oid | | not null | stxstattarget | integer | | not null | stxkeys | int2vector | | not null | stxkind | "char"[] | | not null | stxexprs | pg_node_tree | C | | Indexes: "pg_statistic_ext_oid_index" PRIMARY KEY, btree (oid) "pg_statistic_ext_name_index" UNIQUE CONSTRAINT, btree (stxname, stxnamespace) "pg_statistic_ext_relid_index" btree (stxrelid)
文档: pg_statistic_ext
pg_statistic_ext (PostgreSQL 13)
Table "pg_catalog.pg_statistic_ext" Column | Type | Collation | Nullable | Default ---------------+------------+-----------+----------+--------- oid | oid | | not null | stxrelid | oid | | not null | stxname | name | | not null | stxnamespace | oid | | not null | stxowner | oid | | not null | stxstattarget | integer | | not null | stxkeys | int2vector | | not null | stxkind | "char"[] | | not null | Indexes: "pg_statistic_ext_name_index" UNIQUE, btree (stxname, stxnamespace) "pg_statistic_ext_oid_index" UNIQUE, btree (oid) "pg_statistic_ext_relid_index" btree (stxrelid)
文档: pg_statistic_ext
pg_statistic_ext (PostgreSQL 12)
Table "pg_catalog.pg_statistic_ext" Column | Type | Collation | Nullable | Default --------------+------------+-----------+----------+--------- oid | oid | | not null | stxrelid | oid | | not null | stxname | name | | not null | stxnamespace | oid | | not null | stxowner | oid | | not null | stxkeys | int2vector | | not null | stxkind | "char"[] | | not null | Indexes: "pg_statistic_ext_name_index" UNIQUE, btree (stxname, stxnamespace) "pg_statistic_ext_oid_index" UNIQUE, btree (oid) "pg_statistic_ext_relid_index" btree (stxrelid)
文档: pg_statistic_ext
pg_statistic_ext (PostgreSQL 11)
Table "pg_catalog.pg_statistic_ext" Column | Type | Collation | Nullable | Default -----------------+-----------------+-----------+----------+--------- stxrelid | oid | | not null | stxname | name | | not null | stxnamespace | oid | | not null | stxowner | oid | | not null | stxkeys | int2vector | | not null | stxkind | "char"[] | | not null | stxndistinct | pg_ndistinct | | | stxdependencies | pg_dependencies | | | Indexes: "pg_statistic_ext_name_index" UNIQUE, btree (stxname, stxnamespace) "pg_statistic_ext_oid_index" UNIQUE, btree (oid) "pg_statistic_ext_relid_index" btree (stxrelid)
文档: pg_statistic_ext
pg_statistic_ext (PostgreSQL 10)
Table "pg_catalog.pg_statistic_ext" Column | Type | Collation | Nullable | Default -----------------+-----------------+-----------+----------+--------- stxrelid | oid | | not null | stxname | name | | not null | stxnamespace | oid | | not null | stxowner | oid | | not null | stxkeys | int2vector | | not null | stxkind | "char"[] | | not null | stxndistinct | pg_ndistinct | | | stxdependencies | pg_dependencies | | | Indexes: "pg_statistic_ext_name_index" UNIQUE, btree (stxname, stxnamespace) "pg_statistic_ext_oid_index" UNIQUE, btree (oid) "pg_statistic_ext_relid_index" btree (stxrelid)
文档: pg_statistic_ext
更改历史记录
- PostgreSQL 17
- PostgreSQL 13
- 添加列
stxstattarget
(提交 d06215d0)
- 添加列
- PostgreSQL 12
- 删除以下列(并合并到新表
pg_statistic_ext_data
中,提交 6cbfb784)stxndistinct
stxdependencies
- 删除以下列(并合并到新表
- PostgreSQL 10
- 添加 (提交 7b504eb2)
参考文献
- PostgreSQL 文档: pg_statistic_ext