SELECT A.MAT_NO
, A.MAT_ID
, A.DSN_PRNT_MAT_NO
, A.PROJ_NO
, LEVEL
FROM PHA_MBOM A
WHERE A.PROJ_NO = 'TKSFUK'
AND A.IF_STAT = 'D'
AND A.DEL_ORDR <> 'X'
AND LEVEL <> 1
START WITH A.MAT_ID IN (
SELECT DISTINCT T1.MAT_ID
FROM PHA_MBOM T1
, PHA_MBOM_MA T2
WHERE T1.PROJ_NO = 'TKSFUK'
AND T1.DSN_CD IN ('UU', 'MP')
AND T1.BOM_KND IN ('AS', 'IF')
AND T1.M_ID = T2.BOM_ID
AND T1.G_REV = T2.CHG_REV
AND T2.CAD_OBJ_TP IN ('CS','CH')
) /* 2만건 */
AND A.PROJ_NO = 'TKSFUK'
CONNECT BY PRIOR A.MAT_ID = A.DSN_PRNT_MAT_NO
AND PRIOR A.PROJ_NO = A.PROJ_NO
위에서 start with 절을 빼면 속도가 그나마 좀 나오는데
start with 절을 넣으면 속도가 기존속도보다 20배 늦어지네요.
제가 무엇을 잘못했나요?
|