-- [CQ-2-5-1]
EXPLAIN (ANALYZE,COSTS OFF)
SELECT /*+ Leading((t1 t2)) NestLoop(t1 t2) NoMemoize(t1 t2) */
t1.shop_id ,t2.shop_nm ,t1.mbr_id ,t1.ord_dtm
FROM startdbpg.tr_ord t1
INNER JOIN startdbpg.ms_shop t2 ON (t2.shop_id = t1.shop_id)
WHERE t1.ord_no BETWEEN 1 AND 300;
SQL
복사
-- [CQ-2-5-2]
EXPLAIN (ANALYZE,COSTS OFF)
SELECT t1.shop_id ,MAX(t2.shop_nm) shop_nm ,COUNT(*) entry_cnt
FROM startdbpg.tr_event_entry_big t1
INNER JOIN startdbpg.ms_shop_big t2 ON (t2.shop_id = t1.shop_id)
WHERE t1.entry_dtm >= '20240101'::date
AND t1.entry_dtm < '20240102'::date
GROUP BY t1.shop_id;
SQL
복사
