Planner & statistics

Equi-depth histogram

Also called: histogram_bounds, equi-height histogram

For the values that are not on the most-common list, PostgreSQL splits them into buckets that each hold about the same number of rows, and remembers the boundary value between buckets. That structure is an equi-depth histogram.

What this means

For the values that didn't make the "most common" list, Postgres sorts them and cuts them into buckets that each hold about the same number of rows, remembering the boundary between buckets. That's an equi-depth histogram, and it's how the planner sizes up a range filter like amount > 100, by counting the buckets that fall in range.

Why it matters operationally

It lets the planner estimate range queries such as amount > 100 by counting how many buckets fall in range. Because every bucket holds roughly equal rows, even skewed data is described fairly. A bigger statistics target means more buckets and finer range estimates.

← All glossary terms · GUC reference · Error catalog