sql查询优化(oracle)
1. oracle自上而下解析where语句,表关联语句写在前面,过滤条件写在后面
2. 避免使用*查询(*操作是查询数据字典,耗时)
3. 子查询尽量减少对表的查询
select col1, col2 from t1 where col1 = (select col1 from t2 where ...)
4. 使用decode函数减少处理时间
5. 使用别名as
6. exists代替in,not exists代替not in
7. 用exists代替distinct
8. ...
原创
2020-06-11 11:06:20 ·
123 阅读 ·
0 评论