SYSTEM CATALOGS / SYSTEM CATALOGS
pg_statistic
Read PG 18 manual ↗The catalog pg_statistic stores statistical data about the contents of the database.
- Kind
- System catalogs
- Columns in this snapshot
- 31
- Definition source
- English manual
Columns 31
| Column | Type | Description / reference |
|---|---|---|
starelid | oid | The table or index that the described column belongs to pg_class.oid |
staattnum | int2 | The number of the described column pg_attribute.attnum |
stainherit | bool | If true, the stats include values from child tables, not just the values in the specified relation |
stanullfrac | float4 | The fraction of the column's entries that are null |
stawidth | int4 | The average stored width, in bytes, of nonnull entries |
stadistinct | float4 | The number of distinct nonnull data values in the column. A value greater than zero is the actual number of distinct values. A value less than zero is the negative of a multiplier for the number of rows in the table; for example, a column in which about 80% of the values are nonnull and each nonnull value appears about twice on average could be represented by stadistinct = -0.4. A zero value means the number of distinct values is unknown. |
stakind1 | int2 | A code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row. |
stakind2 | int2 | A code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row. |
stakind3 | int2 | A code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row. |
stakind4 | int2 | A code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row. |
stakind5 | int2 | A code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row. |
staop1 | oid | An operator used to derive the statistics stored in the Nth “slot”. For example, a histogram slot would show the < operator that defines the sort order of the data. Zero if the statistics kind does not require an operator. pg_operator.oid |
staop2 | oid | An operator used to derive the statistics stored in the Nth “slot”. For example, a histogram slot would show the < operator that defines the sort order of the data. Zero if the statistics kind does not require an operator. pg_operator.oid |
staop3 | oid | An operator used to derive the statistics stored in the Nth “slot”. For example, a histogram slot would show the < operator that defines the sort order of the data. Zero if the statistics kind does not require an operator. pg_operator.oid |
staop4 | oid | An operator used to derive the statistics stored in the Nth “slot”. For example, a histogram slot would show the < operator that defines the sort order of the data. Zero if the statistics kind does not require an operator. pg_operator.oid |
staop5 | oid | An operator used to derive the statistics stored in the Nth “slot”. For example, a histogram slot would show the < operator that defines the sort order of the data. Zero if the statistics kind does not require an operator. pg_operator.oid |
stacoll1 | oid | The collation used to derive the statistics stored in the Nth “slot”. For example, a histogram slot for a collatable column would show the collation that defines the sort order of the data. Zero for noncollatable data. pg_collation.oid |
stacoll2 | oid | The collation used to derive the statistics stored in the Nth “slot”. For example, a histogram slot for a collatable column would show the collation that defines the sort order of the data. Zero for noncollatable data. pg_collation.oid |
stacoll3 | oid | The collation used to derive the statistics stored in the Nth “slot”. For example, a histogram slot for a collatable column would show the collation that defines the sort order of the data. Zero for noncollatable data. pg_collation.oid |
stacoll4 | oid | The collation used to derive the statistics stored in the Nth “slot”. For example, a histogram slot for a collatable column would show the collation that defines the sort order of the data. Zero for noncollatable data. pg_collation.oid |
stacoll5 | oid | The collation used to derive the statistics stored in the Nth “slot”. For example, a histogram slot for a collatable column would show the collation that defines the sort order of the data. Zero for noncollatable data. pg_collation.oid |
stanumbers1 | float4[] | Numerical statistics of the appropriate kind for the Nth “slot”, or null if the slot kind does not involve numerical values |
stanumbers2 | float4[] | Numerical statistics of the appropriate kind for the Nth “slot”, or null if the slot kind does not involve numerical values |
stanumbers3 | float4[] | Numerical statistics of the appropriate kind for the Nth “slot”, or null if the slot kind does not involve numerical values |
stanumbers4 | float4[] | Numerical statistics of the appropriate kind for the Nth “slot”, or null if the slot kind does not involve numerical values |
stanumbers5 | float4[] | Numerical statistics of the appropriate kind for the Nth “slot”, or null if the slot kind does not involve numerical values |
stavalues1 | anyarray | Column data values of the appropriate kind for the Nth “slot”, or null if the slot kind does not store any data values. Each array's element values are actually of the specific column's data type, or a related type such as an array's element type, so there is no way to define these columns' type more specifically than anyarray. |
stavalues2 | anyarray | Column data values of the appropriate kind for the Nth “slot”, or null if the slot kind does not store any data values. Each array's element values are actually of the specific column's data type, or a related type such as an array's element type, so there is no way to define these columns' type more specifically than anyarray. |
stavalues3 | anyarray | Column data values of the appropriate kind for the Nth “slot”, or null if the slot kind does not store any data values. Each array's element values are actually of the specific column's data type, or a related type such as an array's element type, so there is no way to define these columns' type more specifically than anyarray. |
stavalues4 | anyarray | Column data values of the appropriate kind for the Nth “slot”, or null if the slot kind does not store any data values. Each array's element values are actually of the specific column's data type, or a related type such as an array's element type, so there is no way to define these columns' type more specifically than anyarray. |
stavalues5 | anyarray | Column data values of the appropriate kind for the Nth “slot”, or null if the slot kind does not store any data values. Each array's element values are actually of the specific column's data type, or a related type such as an array's element type, so there is no way to define these columns' type more specifically than anyarray. |
Column history across versions
Version history 7
- PG 19 → 20changed
- PG 14 → 15changed
- PG 13 → 14changed
- PG 11 → 12changed
- PG 9.6 → 10changed
- PG 9.1 → 9.2changed
- PG 9.0 → 9.1changed
Definition snapshot: english-manuals:86e1c078f654cc00e910403c1ea… · English manual source