Skip to content
← Catalog atlas / pg_statistic_ext

SYSTEM CATALOG · System catalog

pg_statistic_ext

The catalog pg_statistic_ext holds definitions of extended planner statistics. Each row in this catalog corresponds to a statistics object created with CREATE STATISTICS.

First seen PG 10Last seen PG 19Columns 9

Checked column by column against a PostgreSQL 18.6 instance · Raw measurement record ↗

Columns PostgreSQL 18

pg_statistic_ext
COLUMNTYPEDESCRIPTION
oid oidNOT NULL Row identifier
stxrelid oidNOT NULL Table containing the columns described by this objectReferences:pg_class.oid
stxname nameNOT NULL Name of the statistics object
stxnamespace oidNOT NULL The OID of the namespace that contains this statistics objectReferences:pg_namespace.oid
stxowner oidNOT NULL Owner of the statistics objectReferences:pg_authid.oid
stxkeys int2vectorNOT NULL An array of attribute numbers, indicating which table columns are covered by this statistics object; for example a value of 1 3 would mean that the first and the third table columns are coveredReferences:pg_attribute.attnum
stxstattarget smallintDocumented as:int2 stxstattarget controls the level of detail of statistics accumulated for this statistics object by ANALYZE. A zero value indicates that no statistics should be collected. A null value says to use the maximum of the statistics targets of the referenced columns, if set, or the system default statistics target. Positive values of stxstattarget determine the target number of “most common values” to collect.
stxkind "char"[]NOT NULLDocumented as:char[] An array containing codes for the enabled statistics kinds; valid values are: d for n-distinct statistics, f for functional dependency statistics, m for most common values (MCV) list statistics, and e for expression statistics
stxexprs pg_node_tree Expression trees (in nodeToString() representation) for statistics object attributes that are not simple column references. This is a list with one element per expression. Null if all statistics object attributes are simple references.

Columns marked "implicit" are not included in SELECT *; some early statistics views are completed from same-version source, and the extra provenance is shown in the column description.

Common system columns 6

System attributes PostgreSQL provides, normally not expanded by SELECT *. Kept separately so they are not mixed in with ordinary columns.

ColumnsTypeattnum
tableoidoid-6
cmaxcid-5
xmaxxid-4
cmincid-3
xminxid-2
ctidtid-1

Column evolution matrix

Hover a cell for the column type
PresentAdded / type or attribute changeRemoved
COLUMN9.09.19.29.39.49.59.610111213141516171819
oid
stxrelid
stxname
stxnamespace
stxowner
stxkeys
stxkind
stxndistinct
stxdependencies
stxstattarget
stxexprs

9.0 is the coverage baseline; a column already present in the baseline is not marked as added. The matrix aligns columns by name, so a rename appears as the old column removed and a new column added.

Evolution timeline

Changes between adjacent majors

PostgreSQL 17 ← 16

~ stxstattarget: integer → smallint~ stxstattarget: not_null: true → false↕ Column order changed1 column description updates

PostgreSQL 14 ← 13

+ stxexprs1 column description updates

PostgreSQL 13 ← 12

+ stxstattarget1 column description updates

PostgreSQL 12 ← 11

− stxndistinct− stxdependencies~ oid: implicit → ordinary2 column description updatesCatalog description updated

PostgreSQL 10 ← 9.6Catalog added

+ oid+ stxrelid+ stxname+ stxnamespace+ stxowner+ stxkeys+ stxkind+ stxndistinct+ stxdependencies

Compare any two versions

Pick two versions to see added, removed, and retyped columns. The interactive comparison needs JavaScript; the evolution timeline reads fine without it.