3.3.7. 퀴리형태 변형(Query Transformation)을 위한 힌트

USE_CONCAT

예) SELECT /*+ USE_CONCAT */....
     FROM emp
     WHERE job = 'CLERK' OR deptno = 10;

NO_EXPAND

예) SELECT /*+ NO_EXAPND */....
     FROM CUSTOMER
     WHERE CUST_TYPE IN ('A', 'B');

REWRITE

예) SELECT /*+ REWRITE (sales_mv) */
           c.cust_id, MIN(c.cust_name), COUNT(distinct order_id)
      FROM sales s, order o, customer c
      WHERE s.order_id = o.order_id
          AND o.order_cust = c.cust_id
      GROUP BY c.cust_id;

NO_REWRITE

예) SELECT /*+ NOREWRITE */ sum(s.amount_sold) AS dollars
     FROM sales s, times t
     WHERE s.time_id = t.time_id
     GROUP BY t.calendar_month_desc;


MERGE

예) SELECT /*+ MERGE(table_name) */.......

NO_MERGE

예) SELECT /*+ NO_MERGE(table_name) */...........

STAR_TRANSFORMATION

예) SELECT /*+ STAR_TRANSFORMATION */
          d.dept_name, c.cust_city, p.product_name,
		SUM(s.amount), sales_amount
 FROM SALES s, PRODUCTS t, CUSTOMERS c, DEPT d
 WHERE s.product_cd = t.product_cd
     AND s.cust_id = c.cust_id
     AND s.sales_dept = d.dept_no
     AND c.cust_grade between '10' and '15'
     AND d.location = 'SEOUL'
     AND p.product_name IN ('PA001', 'DR210')
 GROUP BY d.dept_name, c.cust_city, p.product_name);


FACT

UNNEST

예) SELECT /*+ UNNEST(@qb) */............
    FROM emp e
    WHERE e.deptno IN (SELECT /*+ QB_NAME(qb) */ d.deptno
                                  FROM dept d
                                  WHERE d.loc = 'DALLAS');


참조한문서

“오라클클럽” http://wiki.oracleclub.com/pages/viewpage.action?pageId=1966265&