1.很多时候用 exists 代替 in 是一个好的选择:
select num from a where num in(select num from b)
用下面的语句替换:
select num from a where exists(select 1 from b where num=a.num)
select num from a where num in(select num from b)
用下面的语句替换:
select num from a where exists(select 1 from b where num=a.num)
本文标题:mysql亿级数据量查询技巧
本文链接:https://www.haomeiwen.com/subject/kotjiftx.html
网友评论