I'm having a weird problem where one of my queries that's using an index gets logged when the "log-queries-not-using-indexes" option is used in my.ini.
The query:
mysql> explain select data.img_url from data,popular where data.model_no= popular.model_no order by popular.popularity desc,popular.y_popularity desc limit 80;+----+-------------+---------+-------+---------------+-----------+---------+--------------------------------+-------+-------------+| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |+----+-------------+---------+-------+---------------+-----------+---------+--------------------------------+-------+-------------+| 1 | SIMPLE | popular | index | PRIMARY,icode | iboth | 10 | NULL | 12139 | Using index || 1 | SIMPLE | data | ref | imodel_no | imodel_no | 130 | odata.popular.model_no | 1 | |+----+-------------+---------+-------+---------------+-----------+---------+--------------------------------+-------+-------------+2 rows in set
In the log:
# Query_time: 0 Lock_time: 0 Rows_sent: 80 Rows_examined: 160select data.img_url from data,popular where data.model_no= popular.model_no order by popular.popularity desc,popular.y_popularity desc limit 80;
Also, what's weird is under EXPLAIN is states PRIMARY,icode as possible keys, but uses iboth (iboth is a normal index on popularity,y_popularity)
I am using MYSQL 5.0.45
Any ideas what's going on here?
The query:
mysql> explain select data.img_url from data,popular where data.model_no= popular.model_no order by popular.popularity desc,popular.y_popularity desc limit 80;+----+-------------+---------+-------+---------------+-----------+---------+--------------------------------+-------+-------------+| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |+----+-------------+---------+-------+---------------+-----------+---------+--------------------------------+-------+-------------+| 1 | SIMPLE | popular | index | PRIMARY,icode | iboth | 10 | NULL | 12139 | Using index || 1 | SIMPLE | data | ref | imodel_no | imodel_no | 130 | odata.popular.model_no | 1 | |+----+-------------+---------+-------+---------------+-----------+---------+--------------------------------+-------+-------------+2 rows in set
In the log:
# Query_time: 0 Lock_time: 0 Rows_sent: 80 Rows_examined: 160select data.img_url from data,popular where data.model_no= popular.model_no order by popular.popularity desc,popular.y_popularity desc limit 80;
Also, what's weird is under EXPLAIN is states PRIMARY,icode as possible keys, but uses iboth (iboth is a normal index on popularity,y_popularity)
I am using MYSQL 5.0.45
Any ideas what's going on here?
Comment