参考资料1:使用连接(JOIN)来代替子查询(Sub-Queries) mysql优化系列记录
http://blog.youkuaiyun.com/hongsejiaozhu/article/details/1876181
参考资料2:网站开发日记(14)-MYSQL子查询和嵌套查询优化
http://dodomail.iteye.com/blog/250199
根据网上这些资料的建议,改用join来试试。
修改前:select * from abc_number_prop where number_id in (select number_id from abc_number_phone where phone = ‘82306839’);
修改后:select a.* from abc_number_prop a inner join abc_number_phone b on a.number_id = b.number_id where phone = ‘82306839’;
转自:
http://www.cnblogs.com/xh831213/archive/2012/05/09/2491272.html
本文介绍了一种MySQL查询优化的方法,通过使用JOIN替代子查询来提高查询效率。文章提供了具体的SQL语句修改前后对比,展示了如何从子查询转换为内连接查询。
3726

被折叠的 条评论
为什么被折叠?



