Bug #54207 | why mysql cann't using index to filter column after range condition ; | ||
---|---|---|---|
Submitted: | 3 Jun 2010 15:05 | Modified: | 9 Jun 2010 7:31 |
Reporter: | He yunfei | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
Version: | 5.1.40, 5.1.48, all | OS: | Linux (5u4) |
Assigned to: | CPU Architecture: | Any |
[3 Jun 2010 15:05]
He yunfei
[7 Jun 2010 7:27]
Valeriy Kravchuk
Please, send the results of: explain select count(distinct col4 ) from index_test where col1='username014' and col3 >= '2010-05-01 00:00:00' and col3 <= '2010-06-03 00:00:00' and col2 = 'dsdlfkj' ; (and EXPLAIN results for other queries, if you want) to check what index is really used.
[7 Jun 2010 8:30]
He yunfei
explain
Attachment: why mysql cann't using index to filter column (text/plain), 9.09 KiB.
[7 Jun 2010 12:00]
guo jun
I get the same results at 5.1.47 with innodb plugin.As I replace "count(distinct XXX )" with col[1-4] and test serverl times,I get the following result: XXX Dif-Innodb_buffer_pool_read_requests col1 16 col2 30 col3 30 col4 107 Why the extra Innodb_buffer_pool_read_requests happend?
[9 Jun 2010 7:31]
Sveta Smirnova
Thank you for the feedback. I was able to repeat the problem. This can be verified as feature request.