Oct 052012
 

A book table like this:

...
PRIMARY KEY (`bookid`),
KEY `authorid` (`authorid`)
...

and the query is something like this:

SELECT * FROM book WHERE authorid = 123

but MySQL refused to use authorid index, instead, it did a full table scan, how stupid!

However, later on it turned to be how stupid I AM. The authorid column was, by whatever reason, defined as varchar instead of int, so MySQL decided not to use the index.

Anyway, I was stupid, but MySQL is stubborn.