[MDEV-27497] DOUBLE_PREC_HB histogram produces wrong estimates for COMPRESSED columns Created: 2022-01-13 Updated: 2023-12-05 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5, 10.6, 10.7 |
| Fix Version/s: | 10.4, 10.5, 10.6 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Elena Stepanova | Assignee: | Sergei Petrunia |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
The actual result set is naturally empty. So, DOUBLE_PREC is close, JSON is far away. Reproducible with at least MyISAM, InnoDB, Aria. |
| Comments |
| Comment by Sergei Petrunia [ 2022-01-14 ] | |||||||||||||||||||||||||||||||||
|
Summarizing the report data:
If I try to remove the COMPRESSED attribute, I get this:
DOUBLE_PREC_HB becomes just as bad as JSON_HB. It looks like the good estimate in the original report has been an accident. | |||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2022-01-14 ] | |||||||||||||||||||||||||||||||||
|
The column is actually too short to be compressed.
| |||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2022-01-14 ] | |||||||||||||||||||||||||||||||||
|
I compare the histograms that were produced when
The JSON_HB histograms are the same. The DOUBLE_PREC_HB histograms are different.
Non-compressed:
| |||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2022-01-14 ] | |||||||||||||||||||||||||||||||||
|
The condition is impossible to satisfy but the optimizer doesn't recognize that. The ranges it is estimating and the estimates: DOUBLE_PREC_HB, non-COMPRESSED:
DOUBLE_PREC_HB, COMPRESSED:
JSON:
what would be the right selectivity for t.a >= 'c'? The two values that are less are aaaaa and bbbbb. | |||||||||||||||||||||||||||||||||
| Comment by Julien Fritsch [ 2023-12-05 ] | |||||||||||||||||||||||||||||||||
|
Automated message: | |||||||||||||||||||||||||||||||||
| Comment by JiraAutomate [ 2023-12-05 ] | |||||||||||||||||||||||||||||||||
|
Automated message: |