[MDEV-17605] Statistics for InnoDB table is wrong if persistent statistics is used Created: 2018-11-02 Updated: 2020-08-25 Resolved: 2019-04-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Information Schema |
| Affects Version/s: | 10.1, 10.2, 10.3, 10.4 |
| Fix Version/s: | 10.2.24, 10.1.39, 10.3.15, 10.4.5 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Valerii Kravchuk | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | upstream | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
When persistent statistics is used for InnoDB it still updates cardinality with values which are incorrect. Basically, upstream bugs: https://bugs.mysql.com/bug.php?id=80178 apply to MariaDB as well. This is a result from the test case on MariaDB 10.3.7, for example:
|
| Comments |
| Comment by Elena Stepanova [ 2018-11-02 ] | ||||||||||||||||||||||||||||||||||||
|
Set to 'Confirmed' because both MySQL and Percona have already confirmed it, I don't expect MariaDB to have any different behavior in regard to InnoDB persistent statistics. | ||||||||||||||||||||||||||||||||||||
| Comment by Valerii Kravchuk [ 2018-11-02 ] | ||||||||||||||||||||||||||||||||||||
|
To show that correct Cardinality is possible, this is what we get for MyISAM:
| ||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2019-01-09 ] | ||||||||||||||||||||||||||||||||||||
|
This appears to have been done on purpose, many years ago:
It looks like this code was added in a merge a long time ago, in MySQL 4.0.2:
Inside the merge, I do not see this, even though the comment suggests that it was not written by Monty, but by Heikki Tuuri, the author of InnoDB. Heikki did change some tweaks to statistics slightly earlier, in MySQL 3.23.48:
MariaDB 10.0.11 added a compensation for these inflated figures in one place:
I think that we should consider removing both tweaks. | ||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2019-04-22 ] | ||||||||||||||||||||||||||||||||||||
|
The reported problem with SHOW INDEXES can be reproduced starting from 10.0. | ||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2019-04-23 ] | ||||||||||||||||||||||||||||||||||||
|
A fix for this bug was pushed into 10.1 |