r-tree index가 있으나 사용하지 못했던 쿼리 개선, N+1 문제 해결 등으로 1s에서 100ms로 응답시간 개선 #128
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.
구현 내용
기존 학원 목록 조회에서 r-tree를 이용함에도 응답시간이 1s가 발생하는 문제가 있었습니다.
이를 해결하기 위해서
따라서 이 문제를 해결하고자
CREATE INDEX idx_academy_id ON academy_categories ( academy_id );
를 통해 인덱스를 만들었고 9개의 row를 읽도록 개선하였습니다.