[MDEV-5884] EXPLAIN UPDATE ... ORDER BY LIMIT shows wrong #rows Created: 2014-03-17 Updated: 2014-06-03 Resolved: 2014-06-03 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.9 |
| Fix Version/s: | 10.0.12 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
After fix for
The output shows as if 100 rows were to be scanned. Actually, we expect to scan LIMIT / where_selectivity rows (here where_selectivity is selectivity of WHERE for results of the range scan). If we assume where_selectivity=1 (which is often done across the optimizer when no other sources of info are present), then we expect to scan LIMIT rows. |
| Comments |
| Comment by Sergei Petrunia [ 2014-03-17 ] |
|
This patch makes the issue to go away. Surprisingly, making get_index_for_order() change *scanned_limit parameter caused fewer changes than I expected. Somehow change in the function only affects EXPLAIN UPDATE output. I'm still concerned about what will happen for selective WHERE clauses.. |