MYSQL子查询的优化

找cid 为1 2 3 中相同的ROWKEY
或是CID 为1 2 3 4 5 这样的多个的,可以写为
select rowkey from conditionresult_tab where cid=1 and rowkey in
(select rowkey from conditionresult_tab where cid=2 and rowkey in
(select rowkey from conditionresult_tab where cid=3))
,就是一个子查询,查询交集的,这样的SQL语句有什么优化方法呢?
现在这样的查询速度特别慢

猜你喜欢

转载自eclecl1314-163-com.iteye.com/blog/1684165