SYSTEM CATALOGS / SYSTEM VIEWS
pg_stats_ext
Read PG 18 manual ↗The view pg_stats_ext provides access to information about each extended statistics object in the database, combining information stored in the pg_statistic_ext and pg_statistic_ext_data catalogs.
- Kind
- System views
- Columns in this snapshot
- 15
- Definition source
- English manual
Columns 15
| Column | Type | Description / reference |
|---|---|---|
schemaname | name | Name of schema containing table pg_namespace.nspname |
tablename | name | Name of table pg_class.relname |
statistics_schemaname | name | Name of schema containing extended statistics object pg_namespace.nspname |
statistics_name | name | Name of extended statistics object pg_statistic_ext.stxname |
statistics_owner | name | Owner of the extended statistics object pg_authid.rolname |
attnames | name[] | Names of the columns included in the extended statistics object pg_attribute.attname |
exprs | text[] | Expressions included in the extended statistics object |
kinds | char[] | Types of extended statistics object enabled for this record |
inherited | bool | If true, the stats include values from child tables, not just the values in the specified relation pg_statistic_ext_data.stxdinherit |
n_distinct | pg_ndistinct | N-distinct counts for combinations of column values. If greater than zero, the estimated number of distinct values in the combination. 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 column seems to have a fixed number of possible values.) For example, -1 indicates a unique combination of columns in which the number of distinct combinations is the same as the number of rows. |
dependencies | pg_dependencies | Functional dependency statistics |
most_common_vals | text[] | A list of the most common combinations of values in the columns. (Null if no combinations seem to be more common than any others.) |
most_common_val_nulls | bool[] | A list of NULL flags for the most common combinations of values. (Null when most_common_vals is.) |
most_common_freqs | float8[] | A list of the frequencies of the most common combinations, i.e., number of occurrences of each divided by total number of rows. (Null when most_common_vals is.) |
most_common_base_freqs | float8[] | A list of the base frequencies of the most common combinations, i.e., product of per-value frequencies. (Null when most_common_vals is.) |
Column history across versions
| Column | 9.0 | 9.1 | 9.2 | 9.3 | 9.4 | 9.5 | 9.6 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
schemaname | · | · | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tablename | · | · | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● |
statistics_schemaname | · | · | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● |
statistics_name | · | · | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● |
statistics_owner | · | · | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● |
attnames | · | · | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● |
kinds | · | · | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● |
n_distinct | · | · | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● |
dependencies | · | · | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● |
most_common_vals | · | · | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● |
most_common_val_nulls | · | · | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● |
most_common_freqs | · | · | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● |
most_common_base_freqs | · | · | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● |
exprs | · | · | · | · | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● |
inherited | · | · | · | · | · | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● |
tableid | · | · | · | · | · | · | · | · | · | · | · | · | · | · | · | · | ● | ● |
statistics_id | · | · | · | · | · | · | · | · | · | · | · | · | · | · | · | · | ● | ● |
Version history 5
- PG 18 → 19changed
- PG 14 → 15changed
- PG 13 → 14changed
- PG 12 → 13changed
- PG 11 → 12added
Definition snapshot: english-manuals:819e1c2052088e9ef26ea4d9916… · English manual source