-
[완료]/*album.base.deleteMultiSeriesCategoryMap*/Postgresql / PPAS/Query tuning 2022. 8. 29. 14:06
AS-IS
Total query runtime: 10000 msec
TO-BE
Total query runtime: 0.063 msec
개선효과 : 99%- 분석 내용
튜닝 내용 : WHERE ( A.VOD_CATEGORY_ID, A.VOD_CONTENTS_ID) IN 해당 분분에서 인덱스를 타지 못함 EXISTS 로 변경요청 * 원본 쿼리
DELETE FROM /*album.base.deleteMultiSeriesCategoryMap*/
voduser.PT_VO_CATEGORY_MAP_UNITED A
WHERE ( A.VOD_CATEGORY_ID, A.VOD_CONTENTS_ID) IN
(
SELECT BB.VOD_CATEGORY_ID, BB.VOD_CONTENTS_ID
FROM voduser.PT_VO_CATEGORY_UNITED AA
, voduser.PT_VO_CATEGORY_MAP_UNITED BB
WHERE AA.VOD_CATEGORY_ID = BB.VOD_CATEGORY_ID
AND A.VOD_CATEGORY_ID = BB.VOD_CATEGORY_ID
AND A.VOD_CONTENTS_ID = BB.VOD_CONTENTS_ID
AND AA.VOD_SERIES_ID = '0042807701'
AND COALESCE(NULLIF(AA.VOD_ACTORS_DISPLAY,''), 'XX') != 'S'
AND BB.VOD_CONTENTS_ID IN
(
'M01191E052PPV00'
,
'M01191E053PPV00'
)
)* 튜닝 쿼리
delete FROM /album.base.deleteMultiSeriesCategoryMap/
voduser.PT_VO_CATEGORY_MAP_UNITED A
where exists
(
SELECT 1
FROM voduser.PT_VO_CATEGORY_UNITED AA
, voduser.PT_VO_CATEGORY_MAP_UNITED BB
WHERE AA.VOD_CATEGORY_ID = BB.VOD_CATEGORY_ID
AND A.VOD_CATEGORY_ID = BB.VOD_CATEGORY_ID
AND A.VOD_CONTENTS_ID = BB.VOD_CONTENTS_ID
AND AA.VOD_SERIES_ID = '0042807701'
AND COALESCE(NULLIF(AA.VOD_ACTORS_DISPLAY,''), 'XX') != 'S'
AND BB.VOD_CONTENTS_ID IN
(
'M01191E052PPV00', 'M01191E053PPV00'
)
);'Postgresql / PPAS > Query tuning' 카테고리의 다른 글
[완료]/*VoteRelation.base.selectAlbumList*/ (0) 2022.08.29 [완료]/*contentExpand.distr.selectExposureNewScheduleList*/ (0) 2022.08.29 [완료]/* categoryForm.base.getAlbumNameSearchList */ (0) 2022.08.29 [완료]/*distribute.distr.distributeListStatusPageData*/ (0) 2022.08.29 [ 완료]/*new4dSchedule.distr.new4dScheduleListPageData*/ (0) 2022.08.29