Search

7-4-4. 여러 테이블의 조인 힌트

-- [SQL-7-4-4-a] EXPLAIN (COSTS OFF) SELECT /*+ Leading(((t1 t2) t3)) */ * FROM startdbpg.ms_shop t1 INNER JOIN startdbpg.tr_ord t2 ON (t1.shop_id = t2.shop_id) INNER JOIN startdbpg.tr_ord_det t3 ON (t3.ord_no = t2.ord_no);
SQL
복사
-- [SQL-7-4-4-b] EXPLAIN (COSTS OFF) SELECT /*+ Leading(((t1 t2) t3)) NestLoop(t1 t2) NestLoop(t1 t2 t3) */ * FROM startdbpg.ms_shop t1 INNER JOIN startdbpg.tr_ord t2 ON (t1.shop_id = t2.shop_id) INNER JOIN startdbpg.tr_ord_det t3 ON (t3.ord_no = t2.ord_no);
SQL
복사
-- [SQL-7-4-4-c] EXPLAIN (COSTS OFF) SELECT /*+ Leading((t3 (t2 t1))) NestLoop(t2 t1) HashJoin(t3 t2 t1) */ * FROM startdbpg.ms_shop t1 INNER JOIN startdbpg.tr_ord t2 ON (t1.shop_id = t2.shop_id) INNER JOIN startdbpg.tr_ord_det t3 ON (t3.ord_no = t2.ord_no);
SQL
복사