[MDEV-26709] JSON histogram may contain bucketS than histogram_size allows Created: 2021-09-28 Updated: 2022-01-19 Resolved: 2021-10-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | N/A |
| Fix Version/s: | 10.7.1 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
One of points from our earlier slack discussion was that there can not be more buckets in a JSON histogram than histogram_size. The below example proves the contrary. It is possible that the conclusion was wrong or too generic and there are allowed exceptions from the rule. These exception will need to be a part of histogram_size description in the KB. The description has to be adjust anyway, as now it says that histogram_size means the number of buckets for JSON histograms, and it's certainly not the case.
|
| Comments |
| Comment by Elena Stepanova [ 2021-09-28 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Another case of an extra bucket. This one also shows that this extra bucket is of a "wrong" size.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2021-10-11 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
... no, it's not about "one more bucket". It can be way more buckets. Example:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2021-10-11 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
239 rows, 50 buckets... gives bucket_capacity=4.78 = 4 The current code will put 4 rows in each bucket and will collect 500 buckets after having examined 50*4= 200 rows. It looks like the idea that we should compute some integer number for rows_in_bucket is not a good one. |