23rd September 2021:
PostgreSQL 14 RC 1 Released!

`pg_stats_ext`

The view `pg_stats_ext`

provides access to the information stored in the `pg_statistic_ext`

and `pg_statistic_ext_data`

catalogs. This view allows access only to rows of `pg_statistic_ext`

and `pg_statistic_ext_data`

that correspond to tables the user has permission to read, and therefore it is safe to allow public read access to this view.

`pg_stats_ext`

is also designed to present the information in a more readable format than the underlying catalogs — at the cost that its schema must be extended whenever new types of extended statistics are added to `pg_statistic_ext`

.

**Table 51.90. pg_stats_ext Columns**

Column Type Description |
---|

Name of schema containing table |

Name of table |

Name of schema containing extended statistic |

Name of extended statistics |

Owner of the extended statistics |

Names of the columns the extended statistics is defined on |

Types of extended statistics enabled for this record |

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 |

Functional dependency statistics |

A list of the most common combinations of values in the columns. (Null if no combinations seem to be more common than any others.) |

A list of NULL flags for the most common combinations of values. (Null when |

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 |

A list of the base frequencies of the most common combinations, i.e., product of per-value frequencies. (Null when |

The maximum number of entries in the array fields can be controlled on a column-by-column basis using the `ALTER TABLE SET STATISTICS`

command, or globally by setting the default_statistics_target run-time parameter.

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.