sql语句性能优化
2017-09-15 15:49
471 查看
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...
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...
相关文章推荐
- SQL语句性能优化(续)
- Mysql 性能优化7【重要】sql语句的优化 浅谈MySQL中优化sql语句查询常用的30种方法(转)
- oracle sql语句性能优化
- sql语句性能优化
- 【查询优化】怎样用SQL语句查看查询的性能指标
- EBS开发性能优化之SQL语句优化
- mysql sql语句优化案例 依靠主要性能指标来判断
- ORACLE性能优化之SQL语句优化
- SQLServer性能优化之改写SQL语句
- 数据库性能优化之SQL语句优化(上)
- 数据库性能优化之SQL语句优化(上)
- 优化临时表使用,SQL语句性能提升100倍
- 数据库性能优化之SQL语句优化
- 【转】ORACLE性能优化之SQL语句优化
- [转]数据库性能优化之SQL语句优化1
- EBS开发性能优化之SQL语句优化
- 使用优化器性能视图获取SQL语句执行环境
- SQLServer性能优化之改写SQL语句
- 数据库性能优化之SQL语句优化
- sql语句性能优化介绍 .