pg_statistic_ext_data
The catalog pg_statistic_ext_data holds data for extended planner statistics defined in pg_statistic_ext. Each row in this catalog corresponds to a statistics object created with CREATE STATISTICS. Normally there is one entry, with stxdinherit = false, for each statistics object that has been analyzed. If the table has inheritance children or partitions, a second entry with stxdinherit = true is also created. This row represents the statistics object over the inheritance tree, i.e., statistics for the data you'd see with SELECT * FROM table*, whereas the stxdinherit = false row represents the results of SELECT * FROM ONLY table. Like pg_statistic, pg_statistic_ext_data should not be readable by the public, since the contents might be considered sensitive. (Example: most common combinations of values in columns might be quite interesting.) pg_stats_ext is a publicly readable view on pg_statistic_ext_data (after joining with pg_statistic_ext) that only exposes information about tables the current user owns.
English manual coverage begins with PostgreSQL 7.4. Source history and runtime observations have their own recorded version boundaries.
Reading PG 18·Select a recorded version
- kind
- catalog
- lang
- en
- measured attributes
- true
- metadata release
- 18.6
- runtime columns
- stxoid, stxdinherit, stxdndistinct, stxddependencies, stxdmcv, stxdexpr
- runtime verified
- false
- source
- english-manual
Definition PG 18
The catalog pg_statistic_ext_data holds data for extended planner statistics defined in pg_statistic_ext. Each row in this catalog corresponds to a statistics object created with CREATE STATISTICS. Normally there is one entry, with stxdinherit = false, for each statistics object that has been analyzed. If the table has inheritance children or partitions, a second entry with stxdinherit = true is also created. This row represents the statistics object over the inheritance tree, i.e., statistics for the data you'd see with SELECT * FROM table*, whereas the stxdinherit = false row represents the results of SELECT * FROM ONLY table. Like pg_statistic, pg_statistic_ext_data should not be readable by the public, since the contents might be considered sensitive. (Example: most common combinations of values in columns might be quite interesting.) pg_stats_ext is a publicly readable view on pg_statistic_ext_data (after joining with pg_statistic_ext) that only exposes information about tables the current user owns.
Catalog columns
| Column | Type | Nullability | Description |
|---|---|---|---|
| stxoid | oid | Not null | Extended statistics object containing the definition for this data |
| stxdinherit | bool | Not null | If true, the stats include values from child tables, not just the values in the specified relation |
| stxdndistinct | pg_ndistinct | Nullable | N-distinct counts, serialized as pg_ndistinct type |
| stxddependencies | pg_dependencies | Nullable | Functional dependency statistics, serialized as pg_dependencies type |
| stxdmcv | pg_mcv_list | Nullable | MCV (most-common values) list statistics, serialized as pg_mcv_list type |
| stxdexpr | pg_statistic[] | Nullable | Per-expression statistics, serialized as an array of pg_statistic type |
Compare versions
Source references
Full definition and evidence JSON
Definition sources
center · PostgreSQL 18 · catalog-bilingual-repair:0a42ccfb0ad40f202f6b561a427c0d1911d0d8b2629ddedda9c34e898f4b83c2
Text language: en · catalog-bilingual-repair:0a42ccfb0ad40f202f6b561a427c0d1911d0d8b2629ddedda9c34e898f4b83c2