码迷,mamicode.com
首页 > 数据库 > 详细

sql优化

时间:2018-07-13 15:13:51      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:str   运算   png   支持   exists   and   HERE   alt   nbsp   

*性能优化

1、select 列名 from table; 

2、where:可参数化支持优化器使用where子句中列上的索引,不可参数化的不支持索引查找

技术分享图片

3、使用between... and /exists 代替 in;

4、用>= 代替!<

5、避免在where中使用运算符,如substring(‘name‘, 1, 1) = ‘黄‘;

6、使用exists 代替 count(*);

sql优化

标签:str   运算   png   支持   exists   and   HERE   alt   nbsp   

原文地址:https://www.cnblogs.com/SmileSunday/p/9304613.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!