총정리
- 컬렉션을 페치 조인하면 페이징이 불가능
- 해결방법
1. ToOne 관계를 모두 페치 조인 (row수를 증각시키지 않으므로 페이징 쿼리에 영향 없음) - Member, Delivery
2. 컬렉션은 지연로딩으로 조회 - OrderItem
3. 지연 로딩 성능 최적화를 위해 Batch Size를 적용 (개별 최적화 @BatchSize)
→ 컬렉션이나 프록시 객체를 한꺼번에 설정한size만큼 in 쿼리로 조회
https://programmer93.tistory.com/83
by 향로 - https://jojoldu.tistory.com/165
좀 더 자세한 N+1 발생 이유 - https://dev-coco.tistory.com/165
join과 Fetch join 차이 - https://cobbybb.tistory.com/18