select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

SYSTEM CATALOGS / SYSTEM VIEWS

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

ColumnTypeDescription / reference
schemanamenameName of schema containing table
pg_namespace.nspname
tablenamenameName of table
pg_class.relname
statistics_schemanamenameName of schema containing extended statistics object
pg_namespace.nspname
statistics_namenameName of extended statistics object
pg_statistic_ext.stxname
statistics_ownernameOwner of the extended statistics object
pg_authid.rolname
attnamesname[]Names of the columns included in the extended statistics object
pg_attribute.attname
exprstext[]Expressions included in the extended statistics object
kindschar[]Types of extended statistics object enabled for this record
inheritedboolIf true, the stats include values from child tables, not just the values in the specified relation
pg_statistic_ext_data.stxdinherit
n_distinctpg_ndistinctN-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.
dependenciespg_dependenciesFunctional dependency statistics
most_common_valstext[]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_nullsbool[]A list of NULL flags for the most common combinations of values. (Null when most_common_vals is.)
most_common_freqsfloat8[]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_freqsfloat8[]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
Version history 5
  1. PG 18 → 19changed
  2. PG 14 → 15changed
  3. PG 13 → 14changed
  4. PG 12 → 13changed
  5. PG 11 → 12added

Definition snapshot: english-manuals:819e1c2052088e9ef26ea4d9916… · English manual source