[MDEV-9404] A wrong execution plan a test case from select_found.test Created: 2016-01-13 Updated: 2016-01-13 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.1.10, 5.3.13, 5.5, 10.0, 10.1 |
| Fix Version/s: | 10.1 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Igor Babaev | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | upstream-fixed | ||
| Description |
|
When working on mdev-8646 I found the following discrepancy between the results of the select_found.test in mysql-5.6 and mariadb-10.
mariadb-10.1 returns
As the select options contain SQL_CALC_FOUND_ROWS the estimate for the examined number of rows should be 200, n |
| Comments |
| Comment by Igor Babaev [ 2016-01-13 ] | ||||||||
|
The wrong estimate and the wrong plan (full index scan of t2 instead of full table scan of t2) is due to this wrong code in JOIN::optimize_inner():
mysql-5.6 uses a different code here:
| ||||||||
| Comment by Elena Stepanova [ 2016-01-13 ] | ||||||||
|
I assume the description was supposed to say that MariaDB 10.1 returns
where 10 is wrong, it should be 200. Same in MySQL 5.5, apparently fixed in MySQL 5.6. |