select /*+ RULE */ t1.object_name, t2.object_name
from big_table t1, big_table t2
where t1.object_id= t2.object_id and t1.owner='WMSYS';
-----------------------------------------------------------
| Id | Operation | Name |
-----------------------------------------------------------
| 0 | SELECT STATEMENT | |
|* 1 | TABLE ACCESS BY INDEX ROWID| BIG_TABLE |
| 2 | NESTED LOOPS | |
| 3 | TABLE ACCESS FULL | BIG_TABLE |
|* 4 | INDEX RANGE SCAN | BIG_TABLE_OWNER_IDX |
-----------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("T1"."OBJECT_ID"="T2"."OBJECT_ID")
4 - access("T1"."OWNER"='WMSYS')
Note
-----
- rule based optimizer used (consider using cbo)
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.02 0.04 0 0 0 0
Execute 0 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 1 0.02 0.04 0 0 0 0
Misses in library cache during parse: 1
Optimizer mode: RULE
Parsing user id: 54 (SCOTT)
Rows Execution Plan
------- ---------------------------------------------------
0 SELECT STATEMENT MODE: HINT: RULE
0 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF 'BIG_TABLE' (TABLE)
0 NESTED LOOPS
0 TABLE ACCESS MODE: ANALYZED (FULL) OF 'BIG_TABLE' (TABLE)
0 INDEX MODE: ANALYZED (RANGE SCAN) OF 'BIG_TABLE_OWNER_IDX'(INDEX)
select t1.object_name, t2.object_name
from big_table t1, big_table t2
where t1.object_id= t2.object_id and t1.owner='WMSYS';
Elapsed: 00:00:26.20
------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 2057K| 133M| | 8094 (2)| 00:01:38 |
|* 1 | HASH JOIN | | 2057K| 133M| 4000K| 8094 (2)| 00:01:38 |
| 2 | TABLE ACCESS BY INDEX ROWID| BIG_TABLE | 83473 | 3016K| | 2527 (1)| 00:00:31 |
|* 3 | INDEX RANGE SCAN | BIG_TABLE_OWNER_IDX | 83473 | | | 199 (2)| 00:00:03 |
| 4 | TABLE ACCESS FULL | BIG_TABLE | 1001K| 29M| | 3289 (2)| 00:00:40 |
------------------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - access("T1"."OBJECT_ID"="T2"."OBJECT_ID")
3 - access("T1"."OWNER"='WMSYS')
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.04 0.06 0 0 0 0
Execute 0 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 1 0.04 0.06 0 0 0 0
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 54 (SCOTT)
Rows Execution Plan
------- ---------------------------------------------------
0 SELECT STATEMENT MODE: ALL_ROWS
0 HASH JOIN
0 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF 'BIG_TABLE' (TABLE)
0 INDEX MODE: ANALYZED (RANGE SCAN) OF 'BIG_TABLE_OWNER_IDX' (INDEX)
0 TABLE ACCESS MODE: ANALYZED (FULL) OF 'BIG_TABLE' (TABLE)
Statistics | RBO | CBO |
---|---|---|
recursive calls | 0 | 0 |
db block gets | 0 | 0 |
consistent gets | 108030537 | 17219 |
physical reads | 3475 | 13265 |
redo size | 404 | 580 |
bytes sent via SQL*Net to client | 954630 | 954630 |
bytes received via SQL*Net from client | 46211 | 46211 |
SQL*Net roundtrips to/from client | 4168 | 4168 |
sorts (memory) | 0 | 0 |
sorts (disk) | 0 | 0 |
rows processed | 62500 | 62500 |
Elapsed | 00:40:11.14 | 00:00:26.20 |
Join Operation | NESTED LOOPS | HASH JOIN |
Optimizer mode | RULE | ALL_ROWS |
update t set value = value + 5 where value > 10;
이름 | Null 유무 | 유형 |
---|---|---|
COH_NO | NOT NULL | VARCHAR2(3) |
PAT_NO | NOT NULL | VARCHAR2(20) |
QUE_FORM_NO | NOT NULL | VARCHAR2(10) |
QUE_NO | NOT NULL | VARCHAR2(15) |
ANSWER | VARCHAR2(1000) | |
ANSWER_EXP | VARCHAR2(100) | |
SYNC | VARCHAR2(5) | |
MEM_NO | VARCHAR2(15) |
select /*+ RULE */ t1.answer, t2.pat_no from research t1, research t2 where t1.pat_no=t2.pat_no and t1.coh_no='031' and rownum < 100000;
OBJECT_NAME OBJECT_NAME
----------------------------- ---------------
V$DBLINK V$DBLINK
V$DBLINK V$DBLINK
V$DBLINK V$DBLINK
V$DBLINK V$DBLINK
V$DBLINK V$DBLINK
V$DBLINK V$DBLINK
99999 개의 행이 선택되었습니다.
경 과: 00:00:40.84
------------------------------------------------------------
| Id | Operation | Name |
------------------------------------------------------------
| 0 | SELECT STATEMENT | |
|* 1 | COUNT STOPKEY | |
| 2 | NESTED LOOPS | |
| 3 | TABLE ACCESS BY INDEX ROWID| RESEARCH |
|* 4 | INDEX RANGE SCAN | INDEX_RESEARCH |
|* 5 | INDEX RANGE SCAN | INDEX_RESEARCH_PAT |
------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter(ROWNUM<100000)
4 - access("T1"."COH_NO"='031')
5 - access("T1"."PAT_NO"="T2"."PAT_NO")
Note
-----
- rule based optimizer used (consider using cbo)
Statistics
----------------------------------------------------------
1 recursive calls
0 db block gets
8230 consistent gets
3 physical reads
0 redo size
3248401 bytes sent via SQL*Net to client
73711 bytes received via SQL*Net from client
6668 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
99999 rows processed
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 6668 0.28 0.39 3 8230 0 99999
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 6670 0.28 0.39 3 8230 0 99999
Misses in library cache during parse: 1
Optimizer mode: RULE
Rows Row Source Operation
------- ---------------------------------------------------
99999 COUNT STOPKEY (cr=8230 pr=3 pw=0 time=600289 us)
99999 NESTED LOOPS (cr=8230 pr=3 pw=0 time=300200 us)
194 TABLE ACCESS BY INDEX ROWID RESEARCH (cr=391 pr=0 pw=0 time=2929 us)
194 INDEX RANGE SCAN INDEX_RESEARCH (cr=197 pr=0 pw=0 time=1180 us)(object id 54437)
99999 INDEX RANGE SCAN INDEX_RESEARCH_PAT (cr=7839 pr=3 pw=0 time=115435 us)(object id 54436)
Rows Execution Plan
------- ---------------------------------------------------
0 SELECT STATEMENT MODE: HINT: RULE
99999 COUNT (STOPKEY)
99999 NESTED LOOPS
194 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF 'RESEARCH' (TABLE)
194 INDEX MODE: ANALYZED (RANGE SCAN) OF 'INDEX_RESEARCH' (INDEX)
99999 INDEX MODE: ANALYZED (RANGE SCAN) OF 'INDEX_RESEARCH_PAT' (INDEX)
select t1.answer, t2.pat_no from research t1, research t2 where t1.pat_no=t2.pat_no and t1.coh_no='031' and rownum < 100000;
OBJECT_NAME OBJECT_NAME
--------------------------------- ---------------------------------
/6b398bf1_RBCollationTablesBui /6b398bf1_RBCollationTablesBui
/6b398bf1_RBCollationTablesBui /6b398bf1_RBCollationTablesBui
/6b398bf1_RBCollationTablesBui /6b398bf1_RBCollationTablesBui
/6b398bf1_RBCollationTablesBui /6b398bf1_RBCollationTablesBui
/6b398bf1_RBCollationTablesBui /6b398bf1_RBCollationTablesBui
/6b398bf1_RBCollationTablesBui /6b398bf1_RBCollationTablesBui
99999 개의 행이 선택되었습니다.
경 과: 00:00:48.62
----------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 99999 | 4003K| 725 (1)| 00:00:05 |
|* 1 | COUNT STOPKEY | | | | | |
| 2 | NESTED LOOPS | | 100K| 4015K| 725 (1)| 00:00:05 |
| 3 | TABLE ACCESS BY INDEX ROWID| RESEARCH | 3162K| 69M| 122 (0)| 00:00:01 |
|* 4 | INDEX RANGE SCAN | INDEX_RESEARCH | | | 4 (0)| 00:00:01 |
|* 5 | INDEX RANGE SCAN | INDEX_RESEARCH_PAT | 836 | 15048 | 5 (0)| 00:00:01 |
----------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter(ROWNUM<100000)
4 - access("T1"."COH_NO"='031')
5 - access("T1"."PAT_NO"="T2"."PAT_NO")
Statistics
----------------------------------------------------------
269 recursive calls
0 db block gets
8320 consistent gets
0 physical reads
0 redo size
3248401 bytes sent via SQL*Net to client
73711 bytes received via SQL*Net from client
6668 SQL*Net roundtrips to/from client
5 sorts (memory)
0 sorts (disk)
99999 rows processed
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.03 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 6668 0.09 0.18 0 8230 0 99999
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 6670 0.09 0.22 0 8230 0 99999
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Rows Row Source Operation
------- ---------------------------------------------------
99999 COUNT STOPKEY (cr=8230 pr=0 pw=0 time=500308 us)
99999 NESTED LOOPS (cr=8230 pr=0 pw=0 time=300214 us)
194 TABLE ACCESS BY INDEX ROWID RESEARCH (cr=391 pr=0 pw=0 time=3711 us)
194 INDEX RANGE SCAN INDEX_RESEARCH (cr=197 pr=0 pw=0 time=1185 us)(object id 54437)
99999 INDEX RANGE SCAN INDEX_RESEARCH_PAT (cr=7839 pr=0 pw=0 time=103883 us)(object id 54436)
Rows Execution Plan
------- ---------------------------------------------------
0 SELECT STATEMENT MODE: ALL_ROWS
99999 COUNT (STOPKEY)
99999 NESTED LOOPS
194 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF 'RESEARCH' (TABLE)
194 INDEX MODE: ANALYZED (RANGE SCAN) OF 'INDEX_RESEARCH' (INDEX)
99999 INDEX MODE: ANALYZED (RANGE SCAN) OF 'INDEX_RESEARCH_PAT' (INDEX)
Statistics | RBO | CBO |
---|---|---|
recursive calls | ||
db block gets | ||
consistent gets | ||
physical reads | ||
redo size | ||
bytes sent via SQL*Net to client | ||
bytes received via SQL*Net from client | ||
SQL*Net roundtrips to/from client | ||
sorts (memory) | ||
sorts (disk) | ||
rows processed | 99999 | 99999 |
- 강좌 URL : http://www.gurubee.net/lecture/3480
- 구루비 강좌는 개인의 학습용으로만 사용 할 수 있으며, 다른 웹 페이지에 게재할 경우에는 출처를 꼭 밝혀 주시면 고맙겠습니다.~^^
- 구루비 강좌는 서비스 제공을 위한 목적이나, 학원 홍보, 수익을 얻기 위한 용도로 사용 할 수 없습니다.