Bug #42282 | Failure to use index for group-by | ||
---|---|---|---|
Submitted: | 22 Jan 2009 22:23 | Modified: | 22 Feb 2009 22:49 |
Reporter: | Baron Schwartz (Basic Quality Contributor) | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 5.0.67 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[22 Jan 2009 22:23]
Baron Schwartz
[22 Jan 2009 22:49]
Sveta Smirnova
Thank you for the report. If I modify test case provided so tabel demo has more rows I get next results: =====bug42282===== create table demo(a int, b int, key(a, b)); insert into demo values (1,1), (1,2), (1,3), (1,4), (1,5),(2, 2), (2,3), (2,1), (3,1); explain select a, max(b) from demo where a = 1; id 1 select_type SIMPLE table demo type ref possible_keys a key a key_len 5 ref const rows 4 Extra Using where; Using index explain select a, max(b) from demo group by a; id 1 select_type SIMPLE table demo type range possible_keys NULL key a key_len 5 ref NULL rows 10 Extra Using index for group-by Is it what you want to see?
[23 Feb 2009 0:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".