[MDEV-26125] Histograms: limited histogram precision causes imprecise estimates Created: 2021-07-11 Updated: 2023-10-03 Resolved: 2023-10-03 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5, 10.6 |
| Fix Version/s: | 10.8.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | histogram-test | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
This is a known limitation but I'm filing a testcase for the record. Generate a 1-millon row population with column "Country" having value distribution according to the "world" database:
As expected, China has a much larger population than Chile. But histogram doesn't allow the optimizer to find this out:
|
| Comments |
| Comment by Sergei Petrunia [ 2021-07-11 ] | |||||||||||||||||||||||||||||||
|
MySQL 8, for comparison:
| |||||||||||||||||||||||||||||||
| Comment by Michael Okoko [ 2021-08-23 ] | |||||||||||||||||||||||||||||||
|
Using the build from PR-1854, this is the output using JSON histograms:
| |||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2022-01-15 ] | |||||||||||||||||||||||||||||||
|
Re-trying with the latest 10.8 tree with JSON_HB Histograms:
| |||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2022-01-18 ] | |||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2023-10-03 ] | |||||||||||||||||||||||||||||||
|
Fixed in 10.8 by |