1 /**
2 Oracle 中的优化;
3
4 1. 硬件设备。
5
6 2. 软件设备调优(修改Oracle中系统参数)。——DBA
7
8 3. SQL语句的调优。
9
10 3.1 终极目标:减少查询次数。
11
12 3.2
13 in 查询 —— 全表扫描(性能低下)
14 exists 查询 —— 全表扫描(命中率高一些)
15
16 使用场合:
17 in 查询适合:in(数据量小的情况)
18 exists 查询适合:exists(数据量大的情况)
19
20 select * from scott.emp where deptno in (select deptno from scott.dept)
21 select * from scott.emp e where exists (select deptno from scott.dept)
22
23 3.3 多多使用commit 或 rollback 释放内存。
24
25 3.4 尽量使用共享池SQL语句。
26
27 3.5 调整I/O操作(使用高速缓存,减少磁盘读写次数)——调整SGA(系统全局区)
28
29 3.6 调整表中的索引。
30
31 3.7 数据簇(硬盘物理存储位置)
32
33 for update ——共享锁(其他人只能看)、独占锁(只能自己用)
34
35 3.8 分散数据存储(分割物理文件)。
36
37 */
38
39 select sum(gets),
sum(getmisses),
1-(
sum(getmisses)
/sum(gets))
from v$rowcache
转载于:https://www.cnblogs.com/huzi007/archive/2013/01/28/2880737.html
转载请注明原文地址: https://mac.8miu.com/read-16969.html