Skip to content
← Catalog atlas / pg_statistic_ext_data

SYSTEM CATALOG · System catalog

pg_statistic_ext_data

The catalog pg_statistic_ext_data holds data for extended planner statistics defined in pg_statistic_ext. Each row in this catalog corresponds to a statistics object created with CREATE STATISTICS. Normally there is one entry, with stxdinherit = false, for each statistics object that has been analyzed. If the table has inheritance children or partitions, a second entry with stxdinherit = true is also created. This row represents the statistics object over the inheritance tree, i.e., statistics for the data you'd see with SELECT * FROM table*, whereas the stxdinherit = false row represents the results of SELECT * FROM ONLY table. Like pg_statistic, pg_statistic_ext_data should not be readable by the public, since the contents might be considered sensitive. (Example: most common combinations of values in columns might be quite interesting.) pg_stats_ext is a publicly readable view on pg_statistic_ext_data (after joining with pg_statistic_ext) that only exposes information about tables the current user owns.

First seen PG 12Last seen PG 19Columns 6

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

Columns PostgreSQL 18

pg_statistic_ext_data
COLUMNTYPEDESCRIPTION
stxoid oidNOT NULL Extended statistics object containing the definition for this dataReferences:pg_statistic_ext.oid
stxdinherit booleanNOT NULLDocumented as:bool If true, the stats include values from child tables, not just the values in the specified relation
stxdndistinct pg_ndistinct N-distinct counts, serialized as pg_ndistinct type
stxddependencies pg_dependencies Functional dependency statistics, serialized as pg_dependencies type
stxdmcv pg_mcv_list MCV (most-common values) list statistics, serialized as pg_mcv_list type
stxdexpr pg_statistic[] Per-expression statistics, serialized as an array of pg_statistic type

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
stxoid
stxdndistinct
stxddependencies
stxdmcv
stxdexpr
stxdinherit

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 15 ← 14

+ stxdinheritCatalog description updated

PostgreSQL 14 ← 13

+ stxdexpr1 column description updatesCatalog description updated

PostgreSQL 12 ← 11Catalog added

+ stxoid+ stxdndistinct+ stxddependencies+ stxdmcv

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.