-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: 댓글과 사용자를 분리 #460
feat: 댓글과 사용자를 분리 #460
Conversation
- 2번: 댓글에 커버링 인덱스 적용 - 3번: 서브쿼리를 활용해 댓글에 커버링 인덱스 적용 - 4번: 댓글에 커버링 인덱스 적용 후 쓰레드 풀을 사용해 댓글, 멤버에 조회
f8ce3fd
to
2627eea
Compare
오랜만입니다 콩 ㅎㅎ 멋진 실험과 그에 근거한 변경사항 잘 보았습니다. 질문할 내용은 다음과 같습니다.
|
|
||
import java.time.LocalDateTime; | ||
|
||
public record CommentMember( |
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.
: comment 와 member를 조인했으므로 commentMember
MemberNickname memberNickname = memberRepository.getMemberNickname(memberId); | ||
|
||
Comment comment = new Comment(roomId, request.comment(), member); | ||
Comment comment = new Comment(roomId, request.comment(), memberId); |
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.
: 더 재활용하기 쉬운 형태를 찾아보기로 함
@@ -0,0 +1 @@ | |||
CREATE INDEX COMMENT_ROOM_ID_COMMENT_ID_IDX ON comment (room_id, id desc); |
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.
우리가 댓글을 Id 순으로 가져오고 있었군요
일단 OK 입니다 👍
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.
바쁘셨을텐데 커버링 인덱스에 대한 테스트 및 커멘트 테이블에 대한 인덱싱까지 해주셨네요.
고생하셨고 바로 머지해도 좋을 것 같습니다!
관련 이슈번호
작업 사항
id desc
인덱스를 추가해 최적화 진행335ms
->209ms
로 응답 시간 단축기타 사항
쓰레드 풀을 활용
했고, Connetion 부족으로 인해 데드락이 발생해 tomcat max thread, hikaricp max connection을 조절했습니다.