1、尽量不要使用模糊查询(会导致相关列的索引不可用);
2、有索引的列避免在sql语句中进行计算操作,尽量不使用not、<>、!=、is null、is not null,不进行数据类型转换、不使用函数、空值;
3、复杂的update和select语句适当拆分,多子句sql语句影响性能;
4、where子句中使用exist和not exist代替in和not in,having;
5、不要用字符格式来声明数字:where id = '100001';
6、不使用select * from ... select count(*) from... ;
7、尽可能少的使用耗费数据库引擎的distinct、union、minus、intersect、order by...
来源:CSDN
作者:LeoGanlin
链接:https://blog.csdn.net/LeoGanlin/article/details/77992581