[MDEV-26901] Estimation for filtered rows less precise with JSON histogram comparing to DOUBLE_PREC (#4) Created: 2021-10-25 Updated: 2022-01-19 Resolved: 2022-01-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | N/A |
| Fix Version/s: | 10.8.1 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
The result set is 2 rows (out of 20):
With DOUBLE_PREC_HB, filtered value is 10.98, which is quite good:
With JSON_HB, it's 35, which isn't so good:
|
| Comments |
| Comment by Elena Stepanova [ 2021-10-25 ] | |||||||||||
|
Raised to critical on procedural reasons. Feel free to demote and remove from "must-do" scope. | |||||||||||
| Comment by Sergei Petrunia [ 2021-11-26 ] | |||||||||||
|
Debugging...
Here, only the value "1" matches a histogram bucket:
The rest of the values do not match a bucket and use this estimate:
| |||||||||||
| Comment by Sergei Petrunia [ 2021-11-26 ] | |||||||||||
|
that is, it seems to be working as intended... | |||||||||||
| Comment by Sergei Petrunia [ 2022-01-11 ] | |||||||||||
|
... but it doesn't mean we should keep it this way. Adjusted the code to avoid this problem |