-
Notifications
You must be signed in to change notification settings - Fork 3
feat : 커뮤니티 쿼리 최적화 및 성능 테스트 #103
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
893dcd9
feat : querydsl 사용하여 토론글 목록 페이징 조회 기능 구현
NCookies d6eda92
feat : 테스트용 100만건 데이터 삽입
NCookies 0a9c26d
feat : 쿼리 1차 개선
NCookies 8116a84
feat : 쿼리 2차 개선 - 쿼리 분리
NCookies 6e7c4f6
feat : 쿼리 개선 번외 - 기존 쿼리 분리 + 서브 쿼리
NCookies ad90d75
feat : 토론글 목록 조회 쿼리 최적화 및 적용 완료
NCookies 843798a
feat : 토론글 목록 조회 시 비추천 데이터도 포함시킴
NCookies 32f243a
feat : VoteResult 패키지 위치 이동
NCookies 774a3b4
docs : 토론글 관련 swagger 업데이트
NCookies ccc703e
feat : 댓글, 대댓글 목록 조회 시 추가 데이터 포함하도록 구현
NCookies a465f76
chore : 성능, 동시성 테스트 파일 패키지 이동
NCookies af0bd16
fix : 잠재적 NPE, GROUP BY 절에 SELECT된 모든 non-aggregate 컬럼을 포함
NCookies File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/org/ezcode/codetest/application/community/service/BaseVoteService.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/main/java/org/ezcode/codetest/domain/community/dto/DiscussionQueryResult.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| package org.ezcode.codetest.domain.community.dto; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| import org.ezcode.codetest.application.usermanagement.user.dto.response.SimpleUserInfoResponse; | ||
| import org.ezcode.codetest.domain.community.model.enums.VoteType; | ||
|
|
||
| import com.querydsl.core.annotations.QueryProjection; | ||
|
|
||
| import lombok.Getter; | ||
|
|
||
| @Getter | ||
| public class DiscussionQueryResult { | ||
|
|
||
| private final Long discussionId; | ||
|
|
||
| private final SimpleUserInfoResponse userInfo; | ||
|
|
||
| private final Long problemId; | ||
|
|
||
| private final String content; | ||
|
|
||
| private final LocalDateTime createdAt; | ||
|
|
||
| private final Long upvoteCount; | ||
|
|
||
| private final Long downvoteCount; | ||
|
|
||
| private final Long replyCount; | ||
|
|
||
| private final VoteType voteStatus; | ||
|
|
||
| @QueryProjection | ||
| public DiscussionQueryResult( | ||
| Long discussionId, | ||
| SimpleUserInfoResponse userInfo, | ||
| Long problemId, | ||
| String content, | ||
| LocalDateTime createdAt, | ||
| Long upvoteCount, | ||
| Long downvoteCount, | ||
| Long replyCount, | ||
| VoteType voteType | ||
| ) { | ||
|
|
||
| this.discussionId = discussionId; | ||
| this.userInfo = userInfo; | ||
| this.problemId = problemId; | ||
| this.content = content; | ||
| this.createdAt = createdAt; | ||
| this.upvoteCount = upvoteCount; | ||
| this.downvoteCount = downvoteCount; | ||
| this.replyCount = replyCount; | ||
|
|
||
| if (voteType == null) { | ||
| this.voteStatus = VoteType.NONE; | ||
| } else if (voteType == VoteType.UP) { | ||
| this.voteStatus = VoteType.UP; | ||
| } else { | ||
| this.voteStatus = VoteType.DOWN; | ||
| } | ||
| } | ||
| } |
67 changes: 67 additions & 0 deletions
67
src/main/java/org/ezcode/codetest/domain/community/dto/ReplyQueryResult.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| package org.ezcode.codetest.domain.community.dto; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| import org.ezcode.codetest.application.usermanagement.user.dto.response.SimpleUserInfoResponse; | ||
| import org.ezcode.codetest.domain.community.model.enums.VoteType; | ||
|
|
||
| import com.querydsl.core.annotations.QueryProjection; | ||
|
|
||
| import lombok.Getter; | ||
|
|
||
| @Getter | ||
| public class ReplyQueryResult { | ||
|
|
||
| private final Long replyId; | ||
|
|
||
| private final SimpleUserInfoResponse userInfo; | ||
|
|
||
| private final Long parentReplyId; | ||
|
|
||
| private final Long discussionId; | ||
|
|
||
| private final String content; | ||
|
|
||
| private final LocalDateTime createdAt; | ||
|
|
||
| private final Long upvoteCount; | ||
|
|
||
| private final Long downvoteCount; | ||
|
|
||
| private final Long childReplyCount; | ||
|
|
||
| private final VoteType voteStatus; | ||
|
|
||
| @QueryProjection | ||
| public ReplyQueryResult( | ||
| Long replyId, | ||
| SimpleUserInfoResponse userInfo, | ||
| Long parentReplyId, | ||
| Long discussionId, | ||
| String content, | ||
| LocalDateTime createdAt, | ||
| Long upvoteCount, | ||
| Long downvoteCount, | ||
| Long childReplyCount, | ||
| VoteType voteType | ||
| ) { | ||
|
|
||
| this.replyId = replyId; | ||
| this.userInfo = userInfo; | ||
| this.parentReplyId = parentReplyId; | ||
| this.discussionId = discussionId; | ||
| this.content = content; | ||
| this.createdAt = createdAt; | ||
| this.upvoteCount = upvoteCount; | ||
| this.downvoteCount = downvoteCount; | ||
| this.childReplyCount = childReplyCount; | ||
|
|
||
| if (voteType == null) { | ||
| this.voteStatus = VoteType.NONE; | ||
| } else if (voteType == VoteType.UP) { | ||
| this.voteStatus = VoteType.UP; | ||
| } else { | ||
| this.voteStatus = VoteType.DOWN; | ||
| } | ||
| } | ||
| } |
2 changes: 1 addition & 1 deletion
2
...st/domain/community/model/VoteResult.java → ...test/domain/community/dto/VoteResult.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.