spin set 묶여서 _spin_count=1로 되있음
SQL ordered by gets? latch 경합 발생 여부 확인?
==============
subobject name 파티셔닝이 있을경우
sqeuences 는 no cache일때 dic cache에 매번 새로 올려서 사용한다
lc object handle heap
핸들 하나에 여러개의 object heap이 있다
==========================
조인의 최적화는 정규화
10053 trace 는 옵티마이저에 대한 분석 가능
hint ordered > from 절의 여러개의 테이블의 조인 순서를 그대로 가라
cost에 대한 제어는 적절한 hint를 통한 제어가 가능하다
0.1 * 10 1
0.5 * 10 5
0.5 * 10 5
0.25 * 10 2.5 3
0.75 * 10 7.5 8
싱글 블록 io 멀티블록 io cpu이용시간
-----------------------------------
싱글블록 read
opt 파일
영향을 주는 요소들 체크:
optimizer_mode 생각 판단 방식
user_ind_columns
user_indexes
user_tables blocks
hash map
build input hash function을 통한 value 생성 및 분류
probe input 큰 테이블을 가지고 와서 붙임
orcl@SYS> set autot trace exp
orcl@SYS> select ename, e.deptno, d.deptno, d.dname
2 from scott.emp e, scott.dept d
3 where e.deptno = d.deptno and ename like 'A%';
Elapsed: 00:00:00.05
Execution Plan
----------------------------------------------------------
Plan hash value: 3625962092
----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 21 | 4 (0)| 00:00:01 |
| 1 | NESTED LOOPS | | | | | |
| 2 | NESTED LOOPS | | 1 | 21 | 4 (0)| 00:00:01 |
|* 3 | TABLE ACCESS FULL | EMP | 1 | 10 | 3 (0)| 00:00:01 |
|* 4 | INDEX UNIQUE SCAN | PK_DEPT | 1 | | 0 (0)| 00:00:01 |
| 5 | TABLE ACCESS BY INDEX ROWID| DEPT | 1 | 11 | 1 (0)| 00:00:01 |
----------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
3 - filter("ENAME" LIKE 'A%')
4 - access("E"."DEPTNO"="D"."DEPTNO")
1 select /*+ USE_HASH(d e) */ ename, e.deptno, d.deptno, d.dname
1 select /*+ USE_MERGE(d e) NO_INDEX(d) */ ename, e.deptno, d.deptno, d.dname
2 from scott.emp e, scott.dept d
3* where e.deptno = d.deptno and ename like 'A%'
orcl@SYS> /
Elapsed: 00:00:00.00
Execution Plan
----------------------------------------------------------
Plan hash value: 3406566467
----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 21 | 8 (25)| 00:00:01 |
| 1 | MERGE JOIN | | 1 | 21 | 8 (25)| 00:00:01 |
| 2 | SORT JOIN | | 1 | 10 | 4 (25)| 00:00:01 |
|* 3 | TABLE ACCESS FULL| EMP | 1 | 10 | 3 (0)| 00:00:01 |
|* 4 | SORT JOIN | | 6 | 66 | 4 (25)| 00:00:01 |
| 5 | TABLE ACCESS FULL| DEPT | 6 | 66 | 3 (0)| 00:00:01 |
----------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
3 - filter("ENAME" LIKE 'A%')
4 - access("E"."DEPTNO"="D"."DEPTNO")
filter("E"."DEPTNO"="D"."DEPTNO")
2 from scott.emp e, scott.dept d
3* where e.deptno = d.deptno and ename like 'A%'
orcl@SYS> /
Elapsed: 00:00:00.01
Execution Plan
----------------------------------------------------------
Plan hash value: 1123238657
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 21 | 7 (15)| 00:00:01 |
|* 1 | HASH JOIN | | 1 | 21 | 7 (15)| 00:00:01 |
|* 2 | TABLE ACCESS FULL| EMP | 1 | 10 | 3 (0)| 00:00:01 |
| 3 | TABLE ACCESS FULL| DEPT | 6 | 66 | 3 (0)| 00:00:01 |
---------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - access("E"."DEPTNO"="D"."DEPTNO")
2 - filter("ENAME" LIKE 'A%')
select distinct employee_id, last_name일 경우 distinct할 필요가 없어서 표현식 제거 즉
트랜스 포메이션 단계에서 제거한다.
'스터디북' 카테고리의 다른 글
<11/14> 잊었니 (0) | 2015.11.14 |
---|---|
[11/13] 실습 1 (0) | 2015.11.13 |
<11/12> Neighbors Know My Name (0) | 2015.11.12 |
<11/11> 기대했단 말야 (0) | 2015.11.11 |
<11/10> Pathétique (0) | 2015.11.10 |