DB & SQL
[oracle] SQL 문장 성능 진단 - TKProf 유틸리티
akasha.park
2023. 3. 24. 15:47
$ tkprof 트레이스파일경로/이름 트레이스분석보고서파일 sys=no
#트레이스 결과 분석
call Parse : 커서를 파싱하고 실행계획을 생성 통계
call Execute : 커서의 실행(단계) 통계
call Fetch : 레코드를 실제로 Fetch 하는 통계
count : Parse, Execute, Fetch 각 단계가 수행된 횟수
cpu : 현재 커서가 각 단계에서 사용한 cpu time
elapsed : 현재 커서가 각 단계를 수행하는 데 소요된 시간
disk : 디스크로부터 읽은 블록 수
query : Consistent 모드에서 읽은 버퍼 블록 수
current : Current 모드에서 읽은 버퍼 블록 수
rows : 각 단계에서 읽거나 갱신한 처리 건수
전체 Count가 많은 경우 :
Execute, Fetch Count가 많은 경우 :
Fetch Count가 많은 경우 :
Fetch Count와 Row가 많은 경우 :
Execute Count와 Fetch Count & Row가 많은 경우 :
Parse Count와 Execute Count & Row가 만은 경우 :
#AutoTrace 결과와 일치하는 항목
db block gets = current
consistent gets = query
physical reads = disk
SQL*Net roundtrips to/from client = fetch count
row processed = fetch rows