System Catalogs / System catalogs
pg_statistic
Read the PG 18 manualThe catalog pg_statistic stores statistical data about the contents of the database.
Reading PG 18current·documented in 24 of 24 versions, 7.4 to 20
- Kind
- System catalogs
- Columns in this snapshot
- 31
- Definition source
- English manual
- Metadata snapshot
- 18.6
Columns 31
As listed in the PostgreSQL 18 manual.
| Column | Type | Description / reference |
|---|---|---|
starelid | oidNOT NULL | The table or index that the described column belongs to pg_class.oid |
staattnum | int2NOT NULL | The number of the described column pg_attribute.attnum |
stainherit | boolNOT NULL | If true, the stats include values from child tables, not just the values in the specified relation |
stanullfrac | float4NOT NULL | The fraction of the column's entries that are null |
stawidth | int4NOT NULL | The average stored width, in bytes, of nonnull entries |
stadistinct | float4NOT NULL | 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 | int2NOT NULL | A code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row. |
stakind2 | int2NOT NULL | A code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row. |
stakind3 | int2NOT NULL | A code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row. |
stakind4 | int2NOT NULL | A code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row. |
stakind5 | int2NOT NULL | A code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row. |
staop1 | oidNOT NULL | 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 | oidNOT NULL | 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 | oidNOT NULL | 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 | oidNOT NULL | 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 | oidNOT NULL | 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 | oidNOT NULL | 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 | oidNOT NULL | 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 | oidNOT NULL | 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 | oidNOT NULL | 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 | oidNOT NULL | 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 10
Definition snapshot: english-manuals:45dabd136acaefdef44754fd15f… · English manual source