pg_stats
pg_stats#
The pg_stats is a publicly readable view on pg_statistic that only exposes information about those tables that are readable by the current user. The pg_stats view presents the contents of pg_statistic in a friendlier format.
All the statistical data is inherently approximate, even assuming that it is up-to-date. The pg_stats schema must be extended whenever new slot types are defined.
Table 1. pg_catalog.pg_stats
Name |
Type |
References |
Description |
|---|---|---|---|
|
name |
pg_namespace.nspname. |
The name of the schema containing the table. |
|
name |
pg_class_internal.relname |
The name of the table. |
|
name |
pg_attribute.attname |
The name of the column this row describes. |
|
real |
The fraction of column entries that are null. |
|
|
integer |
The average storage width in bytes of the column’s entries, calculated as |
|
|
real |
A positive number is an estimate of the number of distinct values in the column; the number is not expected to vary with the number of rows. A negative value is the number of distinct values divided by the number of rows, that is, the ratio of rows with distinct values for the column, negated. This form is used when the number of distinct values increases with the number of rows. A unique column, for example, has an |
|
|
anyarray |
An array containing the most common values in the column, or null if no values seem to be more common. If the |
|
|
real[] |
An array containing the frequencies of the values in the |
|
|
anyarray |
An array of values that divide the column values into groups of approximately the same size. A histogram can be defined only if there is a |
|
correlation |
real |
OushuDB does not calculate the correlation statistic. |