by 커피요쿠르트d [SQL Query] 실행계획 merge 시간 [2013.09.05 16:00:39]
MERGE INTO TBL A USING (SELECT KEY, ENG_NAME2, ENG_NAME3 FROM TBL_IMSI_ENG_NAME_TEST ) B ON (A.KEY = B.KEY AND A.ENG_NAME IS NOT NULL) WHEN MATCHED THEN UPDATE SET A.ENG_NAME2 = B.ENG_NAME2 , A.ENG_NAME3 = B.ENG_NAME3; Execution Plan ----------------------------------------------------------- 0 MERGE STATEMENT Optimizer=ALL_ROWS (Cost=6K Card=167K Bytes=50M) 1 0 MERGE OF 'TBL' 2 1 VIEW 3 2 HASH JOIN (Cost=6K Card=167K Bytes=51M) 4 3 TABLE ACCESS (FULL) OF 'TBL_TEMP_ENG_NAME_TEST' (TABLE) (Cost=392 Card=188K Bytes=9M) 5 3 TABLE ACCESS (FULL) OF 'TBL' (TABLE) (Cost=3K Card=167K Bytes=43M) ----------------------------------------------------------- Predicate information (identified by operation id): ----------------------------------------------------------- 3 - access("A"."KEY"="KEY") 5 - filter("A"."ENG_NAME" IS NOT NULL) -----------------------------------------------------------2번 쿼리와 실행계획입니다. 별 의미 없지만서도...
MERGE INTO TBL A USING (SELECT B.ROWID RID, A.KEY, A.ENG_NAME2, A.ENG_NAME3 FROM TBL_IMSI_ENG_NAME_TEST A, TBL B WHERE A.KEY = B.KEY AND B.ENG_NAME IS NOT NULL ) B ON (A.ROWID = B.RID) WHEN MATCHED THEN UPDATE SET A.ENG_NAME2 = B.ENG_NAME2 , A.ENG_NAME3 = B.ENG_NAME3; Execution Plan ----------------------------------------------------------- 0 MERGE STATEMENT Optimizer=ALL_ROWS (Cost=13K Card=167K Bytes=50M) 1 0 MERGE OF 'TBL' 2 1 VIEW 3 2 HASH JOIN (Cost=13K Card=167K Bytes=56M) 4 3 HASH JOIN (Cost=4K Card=167K Bytes=13M) 5 4 TABLE ACCESS (FULL) OF 'TBL' (TABLE) (Cost=3K Card=167K Bytes=5M) 6 4 TABLE ACCESS (FULL) OF 'TBL_TEMP_ENG_NAME_TEST' (TABLE) (Cost=392 Card=188K Bytes=9M) 7 3 TABLE ACCESS (FULL) OF 'TBL' (TABLE) (Cost=3K Card=366K Bytes=95M) ----------------------------------------------------------- Predicate information (identified by operation id): ----------------------------------------------------------- 3 - access("A".ROWID="B".ROWID) 4 - access("A"."KEY"="B"."KEY") 5 - filter("B"."ENG_NAME" IS NOT NULL) -----------------------------------------------------------
Execution Plan ----------------------------------------------------------- 0 MERGE STATEMENT Optimizer=ALL_ROWS (Cost=3K Card=188K Bytes=31M) 1 0 MERGE OF 'HSHJHG01_IMSI_ENG_NAME_TEST' 2 1 VIEW 3 2 HASH JOIN (Cost=3K Card=188K Bytes=30M) 4 3 TABLE ACCESS (FULL) OF 'HSHJHG01_IMSI_ENG_NAME_TEST' (TABLE) (Cost=392 Card=188K Bytes=6M) 5 3 TABLE ACCESS (FULL) OF 'HSHJHG01_IMSI_ENG_NAME_TEST' (TABLE) (Cost=392 Card=188K Bytes=25M) ----------------------------------------------------------- Predicate information (identified by operation id): ----------------------------------------------------------- 3 - access("A"."HAKBUN"="HAKBUN") 4 - filter("ENG_NAME" IS NOT NULL) -----------------------------------------------------------