↑↓ select ↵ open ⌫ change scope Open full search

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

System Catalogs / System catalogs

pg_statistic

Read the PG 18 manual

The 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.

ColumnTypeDescription / reference
starelidoidNOT NULLThe table or index that the described column belongs to
pg_class.oid
staattnumint2NOT NULLThe number of the described column
pg_attribute.attnum
stainheritboolNOT NULLIf true, the stats include values from child tables, not just the values in the specified relation
stanullfracfloat4NOT NULLThe fraction of the column's entries that are null
stawidthint4NOT NULLThe average stored width, in bytes, of nonnull entries
stadistinctfloat4NOT NULLThe 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.
stakind1int2NOT NULLA code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row.
stakind2int2NOT NULLA code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row.
stakind3int2NOT NULLA code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row.
stakind4int2NOT NULLA code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row.
stakind5int2NOT NULLA code number indicating the kind of statistics stored in the Nth “slot” of the pg_statistic row.
staop1oidNOT NULLAn 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
staop2oidNOT NULLAn 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
staop3oidNOT NULLAn 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
staop4oidNOT NULLAn 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
staop5oidNOT NULLAn 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
stacoll1oidNOT NULLThe 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
stacoll2oidNOT NULLThe 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
stacoll3oidNOT NULLThe 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
stacoll4oidNOT NULLThe 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
stacoll5oidNOT NULLThe 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
Version history 10
  1. 14 → 15 reworded
  2. 13 → 14 reworded
  3. 11 → 12 changed
  4. 9.6 → 10 reworded
  5. 9.1 → 9.2 changed
  6. 9.0 → 9.1 reworded
  7. 8.4 → 9.0 changed
  8. 8.2 → 8.3 reworded
  9. 8.1 → 8.2 reworded
  10. 7.4 → 8.0 reworded

Definition snapshot: english-manuals:45dabd136acaefdef44754fd15f… · English manual source