Prior to MySQL 8.0, MySQL was missing a very well know feature in other RDBMS: optimizer histograms.
The Optimizer Team implemented this feature as more and more MySQL DBAs were requesting it.
Definition
But what are histograms ? For wikipedia, a histogram is an accurate representation of the distribution of numerical data. For RDBMS, a histogram is an approximation of the data distribution within a specific column.
So in MySQL, histograms help the optimizer to find the most efficient Query Plan.
Example
To illustrate how histograms influence the optimizer, I will use data from dbt3.
My query is simple: …
[Read more]