Skip to content

♻️ Refactor 조회 로직 성능 개선 (N+1 제거 및 인메모리 반복 최적화)#30

Merged
huggywuggy1289 merged 6 commits into
developfrom
feature/apple-login-split
Apr 22, 2026
Merged

♻️ Refactor 조회 로직 성능 개선 (N+1 제거 및 인메모리 반복 최적화)#30
huggywuggy1289 merged 6 commits into
developfrom
feature/apple-login-split

Conversation

@huggywuggy1289

Copy link
Copy Markdown
Collaborator

🚀 조회 로직 성능 개선 (N+1 제거 + 인메모리 반복 최적화)


🐞 Issue 1: ExpenseInquiryService.getMonthlyTotalList()

  • 문제: 1 + N 쿼리 (월 목록 조회 + 월별 합계 반복 조회)
  • 해결: GROUP BY 단일 쿼리로 변경 → 1회 쿼리

🐞 Issue 2: WeeklyRecordService.getMonthlyReportArrivals()

  • 문제: N+1 패턴 + 미사용 쿼리 (Dead Code)
  • 해결: 집계 쿼리 재사용 + 불필요 호출 제거 → 2회 쿼리

🐞 Issue 3: Monthly/WeeklyDetailRecordService

  • 문제: 동일 리스트 반복 순회 (filter + count + sum 구조)
  • 해결: groupingBy로 1회 순회 후 Map 재사용

📊 요약

  • 쿼리 최적화: N+1 → 단일/최소 쿼리
  • 메모리 연산 최적화: 반복 순회 → 단일 순회

@huggywuggy1289 huggywuggy1289 added bug Something isn't working feat implement new function labels Apr 22, 2026
@huggywuggy1289 huggywuggy1289 merged commit a166803 into develop Apr 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working feat implement new function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant