Merged
Conversation
| @ApiParam @RequestPart(required = false) List<MultipartFile> files | ||
| ) { | ||
| return null; | ||
| return new ResponseEntity<>( |
Contributor
There was a problem hiding this comment.
return ResponseEntity.status(HTTPSTATUS.CREATED).body(writeRecord(dto)); 이거로 가시죵
| public interface RecordRepository extends JpaRepository<Record, Long> { | ||
| // @Query("select r from RECORD r join fetch r.writer join fetch r.recordColor join fetch r.recordIcon" | ||
| // + " where r.id = :id") | ||
| Optional<Record> findById(Long id); |
Contributor
There was a problem hiding this comment.
패치조인 적용 안한다면 주석처리해서 기본 생성된거로 쓰는거로 하시죠
Jaeyeop-Jung
approved these changes
Dec 29, 2022
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
관련 이슈 번호
설명
레코드 작성과 레코드 조회 API 구현 하였습니다.
이미지 업로드 작업 시 RecordService에서 추가 해야합니다.
Entity에서 여러개의 컬럼이 FetchType.LAZY가 걸려있을 때
Fetch join을 사용하니 여러개가 중첩된 형태의 조인 쿼리가 날라가는걸 발견하였습니다.
Fetch join을 사용하지 않고 조회 vs Fetch join을 사용하고 조회
어떤것이 더 검색 성능이 좋을까가 궁금하여 테스트 해 본 결과
동일 id에 대한 반복테스트는 fetch join을 적용시킨것이 더 빨랐지만,
랜덤한 10개의 id에 대한 테스트는 fetch join을 적용시키지 않은 것이 더 빨랐기 때문에
fetch join 적용을 해제 하였습니다.
변경사항
Record에 지연로딩으로 되어있어 레코드 조회 시 쿼리가 계속 날라가서 패치조인 적용질문사항