mysql中查询 in()参数太多, 导致查询很慢, 使用join优化。
在实例中in查询话费2s, 优化后0.4s
SELECT * from A
LEFT JOIN B ON A.B_ID = B.ID
where B.uuid in (001,002,003....)
优化后
SELECT * from A
INNER JOIN (
select id from B where uuid = 001
union
select id from B where uuid = 002
union
select id from B where uuid = 003 ....
) B on A.B_id = B.id