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

[♻️ refactor] N+1 문제 해결 및 HomeServiceImpl 성능 개선 #177

Closed
4 tasks done
junggyo1020 opened this issue Dec 7, 2024 · 0 comments · Fixed by #178
Closed
4 tasks done

[♻️ refactor] N+1 문제 해결 및 HomeServiceImpl 성능 개선 #177

junggyo1020 opened this issue Dec 7, 2024 · 0 comments · Fixed by #178
Assignees
Labels
♻️ refactor 코드 리팩토링 ex) 형식변경 🐶정교🐶

Comments

@junggyo1020
Copy link
Contributor

junggyo1020 commented Dec 7, 2024

⚙️ ISSUE

📦 HomeServiceImpl

  • 현재 코드는 scrapRepository를 각 InternshipAnnouncement마다 호출함으로써 데이터베이스 접근이 비효율적으로 이루어지고 있다. (N+1 문제 발생)

✅ 개선 하고자 하는 내용

  • Scrap 정보를 한 번에 조회 하도록 변경 (QueryDSL Tuple 활용)
  • Enum Color의 내부 메서드를 활용해서 색상값을 불러오도록 수정
  • 불필요한 메서드를 제거하고, isScrapped 로직을 좀 더 단순하게 수정

🚀 기대 효과

  • N+1 문제 해결
  • 성능 개선 및 가독성 향상
  • 코드의 유지보수성 증가

📄 To-Do

  • Scrap 정보를 한 번에 조회 하도록 변경 (QueryDSL Tuple 활용)
  • Enum Color의 내부 메서드를 활용해서 색상값을 불러오도록 수정
  • 불필요한 메서드를 제거하고, isScrapped 로직을 좀 더 단순하게 수정
  • 성능 테스트 진행
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♻️ refactor 코드 리팩토링 ex) 형식변경 🐶정교🐶
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant