안녕하세요 쿼리 조회를 하는데 이해 안되는 부분이 있어서 글 올립니다.
테이블 내역
기준테이블(10만건 정도) 200 byte
인덱스 : 기준테이블_col1
조인테이블(2000만건 정도) 한로우 2500 byte
인덱스 : 조인컬럼1
select * from 기준테이블, 조인테이블 where 조인컬럼1 = 조인컬럼 2 and 기준테이블_col = '111111';
입니다.
조회 하면 대략 3000건 정도가 나옵니다.
3000건 조회 하는데 속도가 1분이 넘게 걸립니다.
10046 트레이스를 떠보니 다음과 같이 나옵니다.
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 627 1.55
50.80 5306 14069 0 3129
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 629 1.55
50.80 5306 14069 0 3129
Rows (1st) Rows (avg) Rows (max) Row Source Operation
---------- ---------- ---------- ---------------------------------------------------
3129 3129 3129 NESTED LOOPS (cr=14069 pr=5306 pw=0 time=46922555 us)
3129 3129 3129 NESTED LOOPS (cr=10775 pr=2352 pw=0 time=20957083 us cost=6 size=54 card=1)
3129 3129 3129 TABLE ACCESS BY INDEX ROWID OR_ORDM (cr=3896 pr=133 pw=0 time=4242002 us cost=4 size=14 card=1)
3129 3129 3129 INDEX RANGE SCAN SYS_C0012322 (cr=640 pr=14 pw=0 time=30901 us cost=2 size=0 card=2)(object id 74357)
3129 3129 3129 INDEX UNIQUE SCAN SYS_C0012346 (cr=6879 pr=2219 pw=0 time=20540450 us cost=1 size=0 card=1)(object id 74380)
3129 3129 3129 TABLE ACCESS BY INDEX ROWID OR_ORDD (cr=3294 pr=2954 pw=0 time=29253512 us cost=2 size=40card=1)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 627 0.00 0.00
Disk file operations I/O 39 0.00 0.00
gc cr grant 2-way 2572 0.09 1.46
db file sequential read 5306 0.12 47.67 SQL*Net message from client 627 2.66 3.49
gc current block 2-way 443 0.04 0.31
latch: gc element 8 0.00 0.00
gc cr grant congested 5 0.00 0.00
gc current block congested 2 0.00 0.00
latch free 1 0.00 0.00
처리를 할수 있는 방법이 있는지 궁금합니다.