Skip to content

refactor: AnalysisCompletedHandler N+1 쿼리 개선 #68

@Boyeon-Shin

Description

@Boyeon-Shin

대상

AllAnalysisCompletedHandler.java - checkAndGenerateFinal 메서드

변경 내용

최종 평가 생성 시 질문 목록을 순회하면서 질문마다 답변 조회, 피드백 조회를 각각 DB에 요청한다.
질문이 10개면 최소 21번의 쿼리가 발생한다.

  • answerRepository, feedbackRepository를 반복문 안에서 호출하는 구조 제거
  • 세션 ID 기준으로 답변과 피드백을 한 번에 로드하는 Fetch Join 쿼리로 교체

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions