pg_statistic

A system table storing statistical data about the contents of table columns and index expressions

pg_statistic is a system catalogue table storing statistical data about the contents of table columns and index expressions.

pg_statistic has been present in all PostgreSQL versions.

Definition by PostgreSQL version

pg_statistic (PostgreSQL 14)

             Table "pg_catalog.pg_statistic"
   Column    |   Type   | Collation | Nullable | Default 
-------------+----------+-----------+----------+---------
 starelid    | oid      |           | not null | 
 staattnum   | smallint |           | not null | 
 stainherit  | boolean  |           | not null | 
 stanullfrac | real     |           | not null | 
 stawidth    | integer  |           | not null | 
 stadistinct | real     |           | not null | 
 stakind1    | smallint |           | not null | 
 stakind2    | smallint |           | not null | 
 stakind3    | smallint |           | not null | 
 stakind4    | smallint |           | not null | 
 stakind5    | smallint |           | not null | 
 staop1      | oid      |           | not null | 
 staop2      | oid      |           | not null | 
 staop3      | oid      |           | not null | 
 staop4      | oid      |           | not null | 
 staop5      | oid      |           | not null | 
 stacoll1    | oid      |           | not null | 
 stacoll2    | oid      |           | not null | 
 stacoll3    | oid      |           | not null | 
 stacoll4    | oid      |           | not null | 
 stacoll5    | oid      |           | not null | 
 stanumbers1 | real[]   |           |          | 
 stanumbers2 | real[]   |           |          | 
 stanumbers3 | real[]   |           |          | 
 stanumbers4 | real[]   |           |          | 
 stanumbers5 | real[]   |           |          | 
 stavalues1  | anyarray |           |          | 
 stavalues2  | anyarray |           |          | 
 stavalues3  | anyarray |           |          | 
 stavalues4  | anyarray |           |          | 
 stavalues5  | anyarray |           |          | 
Indexes:
    "pg_statistic_relid_att_inh_index" PRIMARY KEY, btree (starelid, staattnum, stainherit)
    

Documentation: pg_statistic

pg_statistic (PostgreSQL 13)

             Table "pg_catalog.pg_statistic"
   Column    |   Type   | Collation | Nullable | Default 
-------------+----------+-----------+----------+---------
 starelid    | oid      |           | not null | 
 staattnum   | smallint |           | not null | 
 stainherit  | boolean  |           | not null | 
 stanullfrac | real     |           | not null | 
 stawidth    | integer  |           | not null | 
 stadistinct | real     |           | not null | 
 stakind1    | smallint |           | not null | 
 stakind2    | smallint |           | not null | 
 stakind3    | smallint |           | not null | 
 stakind4    | smallint |           | not null | 
 stakind5    | smallint |           | not null | 
 staop1      | oid      |           | not null | 
 staop2      | oid      |           | not null | 
 staop3      | oid      |           | not null | 
 staop4      | oid      |           | not null | 
 staop5      | oid      |           | not null | 
 stacoll1    | oid      |           | not null | 
 stacoll2    | oid      |           | not null | 
 stacoll3    | oid      |           | not null | 
 stacoll4    | oid      |           | not null | 
 stacoll5    | oid      |           | not null | 
 stanumbers1 | real[]   |           |          | 
 stanumbers2 | real[]   |           |          | 
 stanumbers3 | real[]   |           |          | 
 stanumbers4 | real[]   |           |          | 
 stanumbers5 | real[]   |           |          | 
 stavalues1  | anyarray |           |          | 
 stavalues2  | anyarray |           |          | 
 stavalues3  | anyarray |           |          | 
 stavalues4  | anyarray |           |          | 
 stavalues5  | anyarray |           |          | 
Indexes:
    "pg_statistic_relid_att_inh_index" UNIQUE, btree (starelid, staattnum, stainherit)
    

Documentation: pg_statistic

pg_statistic (PostgreSQL 12)

             Table "pg_catalog.pg_statistic"
   Column    |   Type   | Collation | Nullable | Default 
-------------+----------+-----------+----------+---------
 starelid    | oid      |           | not null | 
 staattnum   | smallint |           | not null | 
 stainherit  | boolean  |           | not null | 
 stanullfrac | real     |           | not null | 
 stawidth    | integer  |           | not null | 
 stadistinct | real     |           | not null | 
 stakind1    | smallint |           | not null | 
 stakind2    | smallint |           | not null | 
 stakind3    | smallint |           | not null | 
 stakind4    | smallint |           | not null | 
 stakind5    | smallint |           | not null | 
 staop1      | oid      |           | not null | 
 staop2      | oid      |           | not null | 
 staop3      | oid      |           | not null | 
 staop4      | oid      |           | not null | 
 staop5      | oid      |           | not null | 
 stacoll1    | oid      |           | not null | 
 stacoll2    | oid      |           | not null | 
 stacoll3    | oid      |           | not null | 
 stacoll4    | oid      |           | not null | 
 stacoll5    | oid      |           | not null | 
 stanumbers1 | real[]   |           |          | 
 stanumbers2 | real[]   |           |          | 
 stanumbers3 | real[]   |           |          | 
 stanumbers4 | real[]   |           |          | 
 stanumbers5 | real[]   |           |          | 
 stavalues1  | anyarray |           |          | 
 stavalues2  | anyarray |           |          | 
 stavalues3  | anyarray |           |          | 
 stavalues4  | anyarray |           |          | 
 stavalues5  | anyarray |           |          | 
Indexes:
    "pg_statistic_relid_att_inh_index" UNIQUE, btree (starelid, staattnum, stainherit)
    

Documentation: pg_statistic

pg_statistic (PostgreSQL 11)

             Table "pg_catalog.pg_statistic"
   Column    |   Type   | Collation | Nullable | Default 
-------------+----------+-----------+----------+---------
 starelid    | oid      |           | not null | 
 staattnum   | smallint |           | not null | 
 stainherit  | boolean  |           | not null | 
 stanullfrac | real     |           | not null | 
 stawidth    | integer  |           | not null | 
 stadistinct | real     |           | not null | 
 stakind1    | smallint |           | not null | 
 stakind2    | smallint |           | not null | 
 stakind3    | smallint |           | not null | 
 stakind4    | smallint |           | not null | 
 stakind5    | smallint |           | not null | 
 staop1      | oid      |           | not null | 
 staop2      | oid      |           | not null | 
 staop3      | oid      |           | not null | 
 staop4      | oid      |           | not null | 
 staop5      | oid      |           | not null | 
 stanumbers1 | real[]   |           |          | 
 stanumbers2 | real[]   |           |          | 
 stanumbers3 | real[]   |           |          | 
 stanumbers4 | real[]   |           |          | 
 stanumbers5 | real[]   |           |          | 
 stavalues1  | anyarray |           |          | 
 stavalues2  | anyarray |           |          | 
 stavalues3  | anyarray |           |          | 
 stavalues4  | anyarray |           |          | 
 stavalues5  | anyarray |           |          | 
Indexes:
    "pg_statistic_relid_att_inh_index" UNIQUE, btree (starelid, staattnum, stainherit)
    

Documentation: pg_statistic

pg_statistic (PostgreSQL 10)

             Table "pg_catalog.pg_statistic"
   Column    |   Type   | Collation | Nullable | Default 
-------------+----------+-----------+----------+---------
 starelid    | oid      |           | not null | 
 staattnum   | smallint |           | not null | 
 stainherit  | boolean  |           | not null | 
 stanullfrac | real     |           | not null | 
 stawidth    | integer  |           | not null | 
 stadistinct | real     |           | not null | 
 stakind1    | smallint |           | not null | 
 stakind2    | smallint |           | not null | 
 stakind3    | smallint |           | not null | 
 stakind4    | smallint |           | not null | 
 stakind5    | smallint |           | not null | 
 staop1      | oid      |           | not null | 
 staop2      | oid      |           | not null | 
 staop3      | oid      |           | not null | 
 staop4      | oid      |           | not null | 
 staop5      | oid      |           | not null | 
 stanumbers1 | real[]   |           |          | 
 stanumbers2 | real[]   |           |          | 
 stanumbers3 | real[]   |           |          | 
 stanumbers4 | real[]   |           |          | 
 stanumbers5 | real[]   |           |          | 
 stavalues1  | anyarray |           |          | 
 stavalues2  | anyarray |           |          | 
 stavalues3  | anyarray |           |          | 
 stavalues4  | anyarray |           |          | 
 stavalues5  | anyarray |           |          | 
Indexes:
    "pg_statistic_relid_att_inh_index" UNIQUE, btree (starelid, staattnum, stainherit)
    

Documentation: pg_statistic

pg_statistic (PostgreSQL 9.6)

  Table "pg_catalog.pg_statistic"
   Column    |   Type   | Modifiers 
-------------+----------+-----------
 starelid    | oid      | not null
 staattnum   | smallint | not null
 stainherit  | boolean  | not null
 stanullfrac | real     | not null
 stawidth    | integer  | not null
 stadistinct | real     | not null
 stakind1    | smallint | not null
 stakind2    | smallint | not null
 stakind3    | smallint | not null
 stakind4    | smallint | not null
 stakind5    | smallint | not null
 staop1      | oid      | not null
 staop2      | oid      | not null
 staop3      | oid      | not null
 staop4      | oid      | not null
 staop5      | oid      | not null
 stanumbers1 | real[]   | 
 stanumbers2 | real[]   | 
 stanumbers3 | real[]   | 
 stanumbers4 | real[]   | 
 stanumbers5 | real[]   | 
 stavalues1  | anyarray | 
 stavalues2  | anyarray | 
 stavalues3  | anyarray | 
 stavalues4  | anyarray | 
 stavalues5  | anyarray | 
Indexes:
    "pg_statistic_relid_att_inh_index" UNIQUE, btree (starelid, staattnum, stainherit)
    

Documentation: pg_statistic

pg_statistic (PostgreSQL 9.5)

  Table "pg_catalog.pg_statistic"
   Column    |   Type   | Modifiers 
-------------+----------+-----------
 starelid    | oid      | not null
 staattnum   | smallint | not null
 stainherit  | boolean  | not null
 stanullfrac | real     | not null
 stawidth    | integer  | not null
 stadistinct | real     | not null
 stakind1    | smallint | not null
 stakind2    | smallint | not null
 stakind3    | smallint | not null
 stakind4    | smallint | not null
 stakind5    | smallint | not null
 staop1      | oid      | not null
 staop2      | oid      | not null
 staop3      | oid      | not null
 staop4      | oid      | not null
 staop5      | oid      | not null
 stanumbers1 | real[]   | 
 stanumbers2 | real[]   | 
 stanumbers3 | real[]   | 
 stanumbers4 | real[]   | 
 stanumbers5 | real[]   | 
 stavalues1  | anyarray | 
 stavalues2  | anyarray | 
 stavalues3  | anyarray | 
 stavalues4  | anyarray | 
 stavalues5  | anyarray | 
Indexes:
    "pg_statistic_relid_att_inh_index" UNIQUE, btree (starelid, staattnum, stainherit)
    

Documentation: pg_statistic

pg_statistic (PostgreSQL 9.4)

  Table "pg_catalog.pg_statistic"
   Column    |   Type   | Modifiers 
-------------+----------+-----------
 starelid    | oid      | not null
 staattnum   | smallint | not null
 stainherit  | boolean  | not null
 stanullfrac | real     | not null
 stawidth    | integer  | not null
 stadistinct | real     | not null
 stakind1    | smallint | not null
 stakind2    | smallint | not null
 stakind3    | smallint | not null
 stakind4    | smallint | not null
 stakind5    | smallint | not null
 staop1      | oid      | not null
 staop2      | oid      | not null
 staop3      | oid      | not null
 staop4      | oid      | not null
 staop5      | oid      | not null
 stanumbers1 | real[]   | 
 stanumbers2 | real[]   | 
 stanumbers3 | real[]   | 
 stanumbers4 | real[]   | 
 stanumbers5 | real[]   | 
 stavalues1  | anyarray | 
 stavalues2  | anyarray | 
 stavalues3  | anyarray | 
 stavalues4  | anyarray | 
 stavalues5  | anyarray | 
Indexes:
    "pg_statistic_relid_att_inh_index" UNIQUE, btree (starelid, staattnum, stainherit)
    

Documentation: pg_statistic

pg_statistic (PostgreSQL 9.3)

  Table "pg_catalog.pg_statistic"
   Column    |   Type   | Modifiers 
-------------+----------+-----------
 starelid    | oid      | not null
 staattnum   | smallint | not null
 stainherit  | boolean  | not null
 stanullfrac | real     | not null
 stawidth    | integer  | not null
 stadistinct | real     | not null
 stakind1    | smallint | not null
 stakind2    | smallint | not null
 stakind3    | smallint | not null
 stakind4    | smallint | not null
 stakind5    | smallint | not null
 staop1      | oid      | not null
 staop2      | oid      | not null
 staop3      | oid      | not null
 staop4      | oid      | not null
 staop5      | oid      | not null
 stanumbers1 | real[]   | 
 stanumbers2 | real[]   | 
 stanumbers3 | real[]   | 
 stanumbers4 | real[]   | 
 stanumbers5 | real[]   | 
 stavalues1  | anyarray | 
 stavalues2  | anyarray | 
 stavalues3  | anyarray | 
 stavalues4  | anyarray | 
 stavalues5  | anyarray | 
Indexes:
    "pg_statistic_relid_att_inh_index" UNIQUE, btree (starelid, staattnum, stainherit)
    

Documentation: pg_statistic

pg_statistic (PostgreSQL 9.2)

  Table "pg_catalog.pg_statistic"
   Column    |   Type   | Modifiers 
-------------+----------+-----------
 starelid    | oid      | not null
 staattnum   | smallint | not null
 stainherit  | boolean  | not null
 stanullfrac | real     | not null
 stawidth    | integer  | not null
 stadistinct | real     | not null
 stakind1    | smallint | not null
 stakind2    | smallint | not null
 stakind3    | smallint | not null
 stakind4    | smallint | not null
 stakind5    | smallint | not null
 staop1      | oid      | not null
 staop2      | oid      | not null
 staop3      | oid      | not null
 staop4      | oid      | not null
 staop5      | oid      | not null
 stanumbers1 | real[]   | 
 stanumbers2 | real[]   | 
 stanumbers3 | real[]   | 
 stanumbers4 | real[]   | 
 stanumbers5 | real[]   | 
 stavalues1  | anyarray | 
 stavalues2  | anyarray | 
 stavalues3  | anyarray | 
 stavalues4  | anyarray | 
 stavalues5  | anyarray | 
Indexes:
    "pg_statistic_relid_att_inh_index" UNIQUE, btree (starelid, staattnum, stainherit)
    

Documentation: pg_statistic

pg_statistic (PostgreSQL 9.1)

  Table "pg_catalog.pg_statistic"
   Column    |   Type   | Modifiers 
-------------+----------+-----------
 starelid    | oid      | not null
 staattnum   | smallint | not null
 stainherit  | boolean  | not null
 stanullfrac | real     | not null
 stawidth    | integer  | not null
 stadistinct | real     | not null
 stakind1    | smallint | not null
 stakind2    | smallint | not null
 stakind3    | smallint | not null
 stakind4    | smallint | not null
 staop1      | oid      | not null
 staop2      | oid      | not null
 staop3      | oid      | not null
 staop4      | oid      | not null
 stanumbers1 | real[]   | 
 stanumbers2 | real[]   | 
 stanumbers3 | real[]   | 
 stanumbers4 | real[]   | 
 stavalues1  | anyarray | 
 stavalues2  | anyarray | 
 stavalues3  | anyarray | 
 stavalues4  | anyarray | 
Indexes:
    "pg_statistic_relid_att_inh_index" UNIQUE, btree (starelid, staattnum, stainherit)
    

Documentation: pg_statistic

pg_statistic (PostgreSQL 9.0)

  Table "pg_catalog.pg_statistic"
   Column    |   Type   | Modifiers 
-------------+----------+-----------
 starelid    | oid      | not null
 staattnum   | smallint | not null
 stainherit  | boolean  | not null
 stanullfrac | real     | not null
 stawidth    | integer  | not null
 stadistinct | real     | not null
 stakind1    | smallint | not null
 stakind2    | smallint | not null
 stakind3    | smallint | not null
 stakind4    | smallint | not null
 staop1      | oid      | not null
 staop2      | oid      | not null
 staop3      | oid      | not null
 staop4      | oid      | not null
 stanumbers1 | real[]   | 
 stanumbers2 | real[]   | 
 stanumbers3 | real[]   | 
 stanumbers4 | real[]   | 
 stavalues1  | anyarray | 
 stavalues2  | anyarray | 
 stavalues3  | anyarray | 
 stavalues4  | anyarray | 
Indexes:
    "pg_statistic_relid_att_inh_index" UNIQUE, btree (starelid, staattnum, stainherit)
    

Documentation: pg_statistic

pg_statistic (PostgreSQL 8.4)

  Table "pg_catalog.pg_statistic"
   Column    |   Type   | Modifiers 
-------------+----------+-----------
 starelid    | oid      | not null
 staattnum   | smallint | not null
 stanullfrac | real     | not null
 stawidth    | integer  | not null
 stadistinct | real     | not null
 stakind1    | smallint | not null
 stakind2    | smallint | not null
 stakind3    | smallint | not null
 stakind4    | smallint | not null
 staop1      | oid      | not null
 staop2      | oid      | not null
 staop3      | oid      | not null
 staop4      | oid      | not null
 stanumbers1 | real[]   | 
 stanumbers2 | real[]   | 
 stanumbers3 | real[]   | 
 stanumbers4 | real[]   | 
 stavalues1  | anyarray | 
 stavalues2  | anyarray | 
 stavalues3  | anyarray | 
 stavalues4  | anyarray | 
Indexes:
    "pg_statistic_relid_att_index" UNIQUE, btree (starelid, staattnum)
    

Documentation: pg_statistic

pg_statistic (PostgreSQL 8.3)

  Table "pg_catalog.pg_statistic"
   Column    |   Type   | Modifiers 
-------------+----------+-----------
 starelid    | oid      | not null
 staattnum   | smallint | not null
 stanullfrac | real     | not null
 stawidth    | integer  | not null
 stadistinct | real     | not null
 stakind1    | smallint | not null
 stakind2    | smallint | not null
 stakind3    | smallint | not null
 stakind4    | smallint | not null
 staop1      | oid      | not null
 staop2      | oid      | not null
 staop3      | oid      | not null
 staop4      | oid      | not null
 stanumbers1 | real[]   | 
 stanumbers2 | real[]   | 
 stanumbers3 | real[]   | 
 stanumbers4 | real[]   | 
 stavalues1  | anyarray | 
 stavalues2  | anyarray | 
 stavalues3  | anyarray | 
 stavalues4  | anyarray | 
Indexes:
    "pg_statistic_relid_att_index" UNIQUE, btree (starelid, staattnum)
    

Documentation: pg_statistic

pg_statistic (PostgreSQL 8.2)

  Table "pg_catalog.pg_statistic"
   Column    |   Type   | Modifiers 
-------------+----------+-----------
 starelid    | oid      | not null
 staattnum   | smallint | not null
 stanullfrac | real     | not null
 stawidth    | integer  | not null
 stadistinct | real     | not null
 stakind1    | smallint | not null
 stakind2    | smallint | not null
 stakind3    | smallint | not null
 stakind4    | smallint | not null
 staop1      | oid      | not null
 staop2      | oid      | not null
 staop3      | oid      | not null
 staop4      | oid      | not null
 stanumbers1 | real[]   | 
 stanumbers2 | real[]   | 
 stanumbers3 | real[]   | 
 stanumbers4 | real[]   | 
 stavalues1  | anyarray | 
 stavalues2  | anyarray | 
 stavalues3  | anyarray | 
 stavalues4  | anyarray | 
Indexes:
    "pg_statistic_relid_att_index" UNIQUE, btree (starelid, staattnum)
    

Documentation: pg_statistic

Change history

Categories

System catalogue

See also

pg_stats, pg_statistic_ext, pg_statistic_ext_data