본문 바로가기

프로그래밍/oracle

oracle - [Hint]ACCESS 경로를 변경하는 힌트(USE_CONCAT)

반응형

[Hint]ACCESS 경로를 변경하는 힌트(USE_CONCAT)
 
 
[Hint]ACCESS 경로를 변경하는 힌트(USE_CONCAT)

USE_CONCAT 힌트는 WHERE벌에 나타나는 OR를 UNION-ALL 연산을 이용하도록 실행 계획을 세우는 역할을 합니다.

[형식]
/*+ USE_CONCAT */

SELECT ename, sal
FROM   EMP
WHERE  ENAME = 'SMITH'
OR     JOB   = 'CLERK'

-----------------------------------------------------------------
Operation        Object Name        Rows        Bytes        Cost       
-----------------------------------------------------------------
SELECT STATEMENT Optimizer Mode=CHOOSE                4                   3          
  TABLE ACCESS FULL        SCOTT.EMP        4          64          3                                                     


SELECT /*+ USE_CONCAT */
       ENAME, SAL
FROM   EMP
WHERE  ENAME = 'SMITH'
OR     JOB   = 'CLERK'

-----------------------------------------------------------------
Operation        Object Name        Rows        Bytes        Cost       
-----------------------------------------------------------------
Operation        Object Name        Rows        Bytes        Cost        SELECT STATEMENT Optimizer Mode=CHOOSE                4                   4                                 
  CONCATENATION                                                                   
    TABLE ACCESS BY INDEX ROWID        SCOTT.EMP        1          16          2          
      INDEX RANGE SCAN        SCOTT.IDX_EMP_ENAME        1                   1                                                      
    TABLE ACCESS BY INDEX ROWID        SCOTT.EMP        3          48          2          
      INDEX RANGE SCAN        SCOTT.IDX_EMP_JOB        3                   1                                                     
 
 
 
 

반응형