[SWM-427] Apply Predefined Indexes and Verify Performance #154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation ๐ค
Key changes โ
To reviewers ๐
์ธ๋ฑ์ค ์ ์ฉ ์ด์
WHERE
์ ์์ ํน์ ์นผ๋ผ์ ์ด์ฉํ ์กฐ๊ฑด ๊ฒ์์ด ๋นจ๋ผ์ง๋๋ค. ์ธ๋ฑ์ค๊ฐ ์์ผ๋ฉด ๋ฐ์ดํฐ๋ฒ ์ด์ค ์์ง์ ํ ์ด๋ธ ์ ์ฒด๋ฅผ ์ค์บํ์ฌ ์กฐ๊ฑด์ ๋ง๋ ํ์ ์ฐพ์์ผ ํฉ๋๋ค. ํ์ง๋ง ์ธ๋ฑ์ค๊ฐ ์๋ค๋ฉด ์ธ๋ฑ์ค๋ฅผ ์ฌ์ฉํ์ฌ ๋ ๋น ๋ฅด๊ฒ ๊ฒ์์ด ๊ฐ๋ฅํฉ๋๋ค.JOIN
์ ์์ ์กฐ์ธํ ๋ ์ธ๋ฑ์ค๊ฐ ์๋ ๊ฒฝ์ฐ, ๋ฐ์ดํฐ๋ฒ ์ด์ค ์์ง์ ์ธ๋ฑ์ค๋ฅผ ์ด์ฉํ์ฌ ์กฐ์ธ์ ์ํํ ์ ์์ต๋๋ค. ์ด๋ ๋ ํ ์ด๋ธ ๊ฐ์ ๋งค์นญ๋๋ ํ์ ํจ์จ์ ์ผ๋ก ์ฐพ์ ์ ์๋๋ก ๋์์ค๋๋ค.ORDER BY
**๋GROUP BY
์ ์์ ์ธ๋ฑ์ค๋ฅผ ์ฌ์ฉํ๋ฉด ์ ๋ ฌ์ด๋ ๊ทธ๋ฃนํ ์์ ์ด ๋นจ๋ผ์ง๋๋ค.์ธ๋ฑ์ค ์ ์ฉํ๊ธฐ
GET_BY_CODE
,GET_BY_ID
,GET_TOP_RATED_ORDER
,GET_LIST_BY_PLAYLIST_ID
,GET_CODE_SET_BY_MEMBER_ID
,GET_RANDOM_BY_CHANNEL
,GET_VIEW_COUNT_ORDER_BY_CHANNEL
,GET_LATEST_ORDER_BY_CHANNEL
๊ฐ ์์ต๋๋ค.channel
์ธ๋ฑ์ค๋ฅผ ์ฌ์ฉํ ์ ์์์ ๋ํ๋ ๋๋ค.channel
์ธ๋ฑ์ค๊ฐ ์ ํ๋์์ต๋๋ค.**"Using index condition"**
์ ์ธ๋ฑ์ค ์กฐ๊ฑด์ ์ฌ์ฉํ์ฌ ํํฐ๋ง ๋์์์ ๋ํ๋ ๋๋ค.์นด๋๋๋ฆฌํฐ ์์น