Here is the table definition
CREATE TABLE `dt_prdtime` (
`TCompany` varchar(3) NOT NULL DEFAULT \'\',
`TPerCode` varchar(8) NOT NULL,
`TBegDateTime` dateti
Neither MyISAM, nor InnoDB, is likely to use an index when "too much" of the table needs to be fetched.
IN (5,6) may mean 2/12ths of the table needs to be scanned? Or maybe the data is biased such that those two months have more than their share of rows?
The reason the optimizer might eschew the index in cases like this...
When using such an index, it needs to spend a lot of time bouncing between the index (one BTree) and the data.
When not using the index, it simply cruises through the data, ignoring 10/12ths of the rows. This may actually be faster.