[MDEV-8350] poor query plan: ideal index from ORDER BY field is not used when extra columns retrieved - mrr=on and join_cache_level>2 Created: 2015-06-22 Updated: 2022-09-12 Resolved: 2022-09-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.0.19 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Daniel Black | Assignee: | Sergei Petrunia |
| Resolution: | Won't Fix | Votes: | 1 |
| Labels: | mrr, order-by-optimization | ||
| Issue Links: |
|
||||||||
| Description |
|
base tables and content:
An ideal query plan:
When we add another field to result, customers.customers_username then we end up doing a temporary and filesort.
|
| Comments |
| Comment by Daniel Black [ 2015-06-22 ] | ||||||||||||||||||||||||||||||
|
MyISAM is much more behaved:
| ||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2015-06-23 ] | ||||||||||||||||||||||||||||||
|
config:
same result after ANALYZE TABLE {tbl} and ANALYZE TABLE {tbl}PERSISTENT FOR ALL | ||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-06-23 ] | ||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-06-23 ] | ||||||||||||||||||||||||||||||
|
However, I don't see a regression from MyISAM:
| ||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2015-06-23 ] | ||||||||||||||||||||||||||||||
|
> However, I don't see a regression from MyISAM: quite right. i didn't do an analyze table after changing the engine type. | ||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-09-12 ] | ||||||||||||||||||||||||||||||
|
10.0 was EOLed in March 2019 |