[MDEV-27243] Estimation for filtered rows less precise with JSON histogram comparing to DOUBLE_PREC (#7) upon TIME comparison Created: 2021-12-12 Updated: 2022-01-19 Resolved: 2022-01-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer, Temporal Types |
| Affects Version/s: | N/A |
| Fix Version/s: | 10.8.1 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Sergei Petrunia |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Upon request, I intentionally make tables bigger than they need to be for reproducing the problem, so that both the number of rows and the number of unique values exceed the histogram size.
JSON_HB:
DOUBLE_PREC_HB:
|
| Comments |
| Comment by Sergei Petrunia [ 2021-12-26 ] | ||||||||||||||||
|
ANALYZE SELECT * FROM t1 WHERE f > '00:01:00'; in Histogram_json_hb::range_selectivity():
We hit the first bucket...
which gives filtered=99%. Things go wrong when we consider the singleton bucket to be a general bucket (which spans from 00:00 to 02:00) and call position_in_interval(00:01). This returns some value (which doesn't look perfect btw), but the issue here is that for the singleton bucket we can see that min_endp > bucket_start which means sel=1.0. | ||||||||||||||||
| Comment by Sergei Petrunia [ 2022-01-08 ] | ||||||||||||||||
|
Fixed by fix for |