# Histogram


![left](./student-guide/diagram/18-histogram-01-01.png)

------------------------------------------------------------

A histogram is a tool that describes the distribution of data (a column) so that the database knows what data it contains, so that the optimizer can use the histogram to determine the distribution range of occurrences.

Most databases choose to use histograms to estimate interval queries. The histogram buckets the values by size, and describes each bucket with some simple metrics, such as the number of values that fall into the bucket (bucket). Depending on the bucket strategy, common histograms can be divided into isobath histograms (also called isoheight histograms) and isobath histograms. The isobath histogram stores one value per bucket (bucket) and the cumulative frequency of this value. Each bucket of isobath histograms needs to store the number of different values, the upper and lower limits, and the cumulative frequency.
