I have an InnoDB table and an index on age
column just like this
CREATE TABLE Person (
....
age int(11) not null;
key (age);
....
) engine=InnoDB;
I just want to know the real things behind these queries:
SELECT * FROM Person WHERE age IN [1, 2, 3];
and
SELECT * FROM Person WHERE age BETWEEN 1 AND 3;
As what I've learnt, the first one MySQL will use the index on column age while the second one it can't use. Is it? Which is better for performance?