Why Index could refuse to work ?
Posted by peter |
Have you ever seen index which refused to be used even if there is every reason for it to work (from the glance view):
SQL:
-
mysql> EXPLAIN SELECT * FROM article WHERE article_id=10;
-
+----+-------------+---------+------+---------------+------+---------+------+-------+-------------+
-
| id | select_type | TABLE | type | possible_keys | KEY | key_len | ref | rows | Extra |
-
+----+-------------+---------+------+---------------+------+---------+------+-------+-------------+
-
| 1 | SIMPLE | article | ALL | PRIMARY | NULL | NULL | NULL | 93490 | USING WHERE |
-
+----+-------------+---------+------+---------------+------+---------+------+-------+-------------+
-
1 row IN SET (0.00 sec)
Why on the earth index would not be used you would think, even if MySQL is mentioning it in "possible keys" ? Should you try to force it ?











del.icio.us
digg