SELECT
s.USN
,s.HERO_ID
,s.SKIN_ID
,(SELECT WEAPON_ID FROM dbo.USER_WEAPON as w where usn = s.USN AND WEAPON_SERIAL = s.WEAPON_SERIAL_1)
,(SELECT WEAPON_ID FROM dbo.USER_WEAPON as w where usn = s.USN AND WEAPON_SERIAL = s.WEAPON_SERIAL_2)
,(SELECT WEAPON_ID FROM dbo.USER_WEAPON as w where usn = s.USN AND WEAPON_SERIAL = s.WEAPON_SERIAL_3)
,(SELECT WEAPON_ID FROM dbo.USER_WEAPON as w where usn = s.USN AND WEAPON_SERIAL = s.WEAPON_SERIAL_4)
,(SELECT WEAPON_ID FROM dbo.USER_WEAPON as w where usn = s.USN AND WEAPON_SERIAL = s.WEAPON_SERIAL_5)
,(SELECT WEAPON_ID FROM dbo.USER_WEAPON as w where usn = s.USN AND WEAPON_SERIAL = s.WEAPON_SERIAL_6)
FROM dbo.USER_SKIN as s
WHERE USN = @IN_USN
이런쿼리가 있는데 실행계획을 보게되면 서브쿼리 때문에 USER_WEAPON 테이블에 액세스를 6번 하게 되어있는데요
USER_WEAPON 테이블에 액세스 1번만 하도록 튜닝가능할까요?
테이블구조는 변경할수없습니다
|