-
Notifications
You must be signed in to change notification settings - Fork 1
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
CLAP-407 task 테이블 인덱스 추가 및 작업 조회시 닉네임 검색 쿼리 수정 #528
Conversation
.select(taskEntity.count()) | ||
.from(taskEntity) | ||
.where(builder) | ||
.fetch().size(); | ||
.fetchOne(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
지금 count 쿼리에서는 조인을 걸지 않으시고 일반 쿼리에서는 left join 되고 있어서 count 쿼리에도 left join이 필요할 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
예를들어 아래 쿼리는 processor, requester와의 조인된 결과(null인 경우 포함)를 가져옵니다.
List<TaskEntity> result = queryFactory
.selectFrom(taskEntity)
.leftJoin(taskEntity.processor).fetchJoin()
.leftJoin(taskEntity.requester).fetchJoin()
.where(builder)
.orderBy(orderSpecifier)
.offset(pageable.getOffset())
.limit(pageable.getPageSize())
.fetch();
반면 아래는 task에 대한 개수만 가지고 옵니다.
.select(taskEntity.count())
.from(taskEntity)
.where(builder)
.fetchOne();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인했습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다!
📄 요약(Summary)
✍🏼 상세(More)
PR Desciption
Requirements for Reviewer
PR Log
새롭게 배운 것
고민 중인 사항
첨부 자료
Requirements for Reviewer
✅ 체크리스트(Checklist)
🚪 이슈 번호(Issue numbers)
Closes #526