select open change scope Open full search

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

SYSTEM CATALOGS / SYSTEM CATALOGS

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

ColumnTypeDescription / reference
starelidoidThe table or index that the described column belongs to
pg_class.oid
staattnumint2The number of the described column
pg_attribute.attnum
stainheritboolIf true, the stats include values from child tables, not just the values in the specified relation
stanullfracfloat4The fraction of the column's entries that are null
stawidthint4The average stored width, in bytes, of nonnull entries
stadistinctfloat4The 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.
stakind1int2A code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row.
stakind2int2A code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row.
stakind3int2A code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row.
stakind4int2A code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row.
stakind5int2A code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row.
staop1oidAn 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
staop2oidAn 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
staop3oidAn 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
staop4oidAn 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
staop5oidAn 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
stacoll1oidThe 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
stacoll2oidThe 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
stacoll3oidThe 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
stacoll4oidThe 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
stacoll5oidThe 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
stanumbers1float4[]Numerical statistics of the appropriate kind for the Nth “slot”, or null if the slot kind does not involve numerical values
stanumbers2float4[]Numerical statistics of the appropriate kind for the Nth “slot”, or null if the slot kind does not involve numerical values
stanumbers3float4[]Numerical statistics of the appropriate kind for the Nth “slot”, or null if the slot kind does not involve numerical values
stanumbers4float4[]Numerical statistics of the appropriate kind for the Nth “slot”, or null if the slot kind does not involve numerical values
stanumbers5float4[]Numerical statistics of the appropriate kind for the Nth “slot”, or null if the slot kind does not involve numerical values
stavalues1anyarrayColumn 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.
stavalues2anyarrayColumn 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.
stavalues3anyarrayColumn 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.
stavalues4anyarrayColumn 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.
stavalues5anyarrayColumn 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
Column9.09.19.29.39.49.59.61011121314151617181920
starelid
staattnum
stainherit
stanullfrac
stawidth
stadistinct
stakind1·
stakind2·
stakind3·
stakind4·
stakind5···
staop1·
staop2·
staop3·
staop4·
staop5···
stanumbers1·
stanumbers2·
stanumbers3·
stanumbers4·
stanumbers5···
stavalues1·
stavalues2·
stavalues3·
stavalues4·
stavalues5···
stacoll1··········
stacoll2··········
stacoll3··········
stacoll4··········
stacoll5··········
stakindN·················
staopN·················
stacollN·················
stanumbersN·················
stavaluesN·················
Version history 7
  1. PG 19 → 20changed
  2. PG 14 → 15changed
  3. PG 13 → 14changed
  4. PG 11 → 12changed
  5. PG 9.6 → 10changed
  6. PG 9.1 → 9.2changed
  7. PG 9.0 → 9.1changed

Definition snapshot: english-manuals:86e1c078f654cc00e910403c1ea… · English manual source