Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

수거함 위도,경도 별 목록 조회 시 N+1 문제 해결 #96

Merged
merged 2 commits into from
May 13, 2024

Conversation

Doyeon04
Copy link
Contributor

@Doyeon04 Doyeon04 commented May 10, 2024

💡 작업 내용

  • 수거함 목록 조회시 N+1 문제 fetch join 으로 해결
  • .log 확장자 파일 gitignore 추가

💡 자세한 설명

CollectingBox와 Location은 일대일 단방향 연관관계로, Location은 LAZY 로딩으로 설정되어 있습니다.
이 때문에 수거함 조회 시 수거함 조회 쿼리 1번과 각 수거함에 연관된 위치를 가져오기 위해 N번의 추가 쿼리가 나가는 N+1문제가 발생합니다.
따라서 fetch join 을 사용해 연관된 엔티티를 한번에 로드하도록 수정했습니다.

✅ 셀프 체크리스트

  • PR 제목을 형식에 맞게 작성했나요?
  • 브랜치 전략에 맞는 브랜치에 PR을 올리고 있나요?
  • 이슈는 close 했나요?
  • Reviewers, Labels, Projects를 등록했나요?
  • 작업 도중 문서 수정이 필요한 경우 잘 수정했나요?
  • 테스트는 잘 통과했나요?
  • 불필요한 코드는 제거했나요?

closes #95

@Doyeon04 Doyeon04 added the feature 구현, 개선 사항 관련 label May 10, 2024
@Doyeon04 Doyeon04 requested a review from Hanjaemo May 10, 2024 11:11
@Doyeon04 Doyeon04 self-assigned this May 10, 2024
@Doyeon04 Doyeon04 linked an issue May 10, 2024 that may be closed by this pull request
@Doyeon04 Doyeon04 merged commit 7664ed9 into main May 13, 2024
1 check passed
@Doyeon04 Doyeon04 deleted the feat/95-fix-n+1-read-list branch May 13, 2024 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 구현, 개선 사항 관련
Projects
None yet
Development

Successfully merging this pull request may close these issues.

수거함 목록 조회 시 N+1 문제 해결
2 participants