Skip to content

perf : HomebaseReservation 조회 쿼리 카디널 곱 문제 해결 #209

Description

@s-chan-o

문제

findAllWithMembers(), findAllWithMembersByDate() 에서 LEFT JOIN FETCH r.members 사용 시 OneToMany 관계로 인해 카디널 곱 발생.
예약 1건에 멤버 N명이면 SQL 결과 행이 N배로 증가하여 메모리 낭비 및 페이징 불가 문제.

해결 방안

쿼리를 2개로 분리:

  1. 예약 + homebase 조회 (members 제외)
  2. 예약 ID 목록으로 멤버 일괄 조회 후 메모리에서 조합

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions