[MDEV-4932] query with order by on indexed column is using filesort Created: 2013-08-21 Updated: 2018-09-19 Resolved: 2015-09-07 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 5.5.32 |
| Fix Version/s: | 10.1.7 |
| Type: | Bug | Priority: | Major |
| Reporter: | Patryk Pomykalski | Assignee: | Oleksandr Byelkin |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
With a small amount of rows filesort is used instead of index scan:
The same is without LIMIT. Analyze table didn't help in this example.
|
| Comments |
| Comment by Patryk Pomykalski [ 2013-08-21 ] |
|
file with insert data |
| Comment by Patryk Pomykalski [ 2013-08-22 ] |
|
In this case both costs read_time and index_scan_time are equal to 1. In test_if_cheaper_ordering() index scan is considered if the cost is strictly lower than read_time. Maybe it would be better to change < to <= ? — sql/sql_select.cc 2013-08-21 18:27:02 +0000
|
| Comment by Oleksandr Byelkin [ 2015-09-07 ] |
|
It looks like bug is not reproducible any more on 10.1 (checked with innodb and aria). |
| Comment by Oleksandr Byelkin [ 2015-09-07 ] |
|
We can not reproduce it on 10.1. But if you feel that we are wrong please reopen it. |