MySQL index doesn't help in IN

If I write this query,

EXPLAIN SELECT * FROM `smth` WHERE d_id = 9

it checks one row instantly. But when I use IN, for example

EXPLAIN SELECT * FROM `smth` WHERE d_id IN (9, 3)

it checks all rows. What should I do instead of IN if index doesn't help there?

5
задан Peter Mortensen 18 September 2010 в 18:44
поделиться