在MySQL5中,where语句里使用
(A,B) in ((X1,Y1),(X2,Y2))索引不会被使用。所以类似
select * from t1, t2 where (t1.a, t2.b) in ((1,2),(2,3))的语句是无法使用a,b上的索引的,应该改为
select * from t1, t2 where (t1.a = 1 and t2.b = 2) or (t1.a = 2 and t2.b = 3)