1 查询时尽量避免使用*号,按需查询所需的cols。2 避免使用in、not in,使用exists 和 not exists替代。3 尽量避免使用like4 查询数据条数时不要使用select count(*),将* 替换成索引行或者id。 ...
1 查询时尽量避免使用*号,按需查询所需的cols。
2 避免使用in、not in,使用exists 和 not exists替代。
3 尽量避免使用like
4 查询数据条数时不要使用select count(*),将* 替换成索引行或者id。
原标题:sql语句的优化技巧
关键词:sql
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。