-
Notifications
You must be signed in to change notification settings - Fork 1
차량 대절 쿼리 성능 개선 #228
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
차량 대절 쿼리 성능 개선 #228
Conversation
…nfo, add property recruitmentCount and passengerCount
- query fix - rentJoin apply method logic refactoring
- almost remove querydsl and replace spring data jpa query method - rentJoin dto package move to rentjoin package - fixed test code
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.
Pull Request Overview
This PR improves query performance for vehicle rental requests by denormalizing passenger counts, updating table and column names, and optimizing join conditions with added indexes.
- Changed table names and updated query joins to use the new RentBoardingInfo table instead of RentBoardingDate.
- Removed unused entities and repositories, and updated domain models and repository interfaces accordingly.
- Improved performance by updating query join conditions and adding necessary indexes.
Reviewed Changes
Copilot reviewed 50 out of 50 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/backend/allreva/rent/infra/rdb/RentDslRepositoryImpl.java | Updated query joins and projections to use RentBoardingInfo. |
| src/main/java/com/backend/allreva/rent/infra/rdb/RentBoardingInfoJpaRepository.java | Introduced new repository interface for RentBoardingInfo. |
| src/main/java/com/backend/allreva/rent/infra/rdb/RentBoardingDateJpaRepository.java | Removed the obsolete RentBoardingDate repository. |
| src/main/java/com/backend/allreva/rent/command/domain/value/AdditionalInfo.java | Removed recruitmentCount field in favor of denormalizing via RentBoardingInfo. |
| src/main/java/com/backend/allreva/rent/command/domain/Rent.java | Renamed table and updated associations to use boardingInfos. |
| src/main/java/com/backend/allreva/rent/command/application/request/RentRegisterRequest.java | Updated entity creation to use RentBoardingInfo instead of RentBoardingDate. |
| src/main/java/com/backend/allreva/rent/command/application/RentCommandService.java | Updated deletion logic to match the new boarding info structure. |
| Various security configuration files | Removed local test security configurations and filters. |
Comments suppressed due to low confidence (1)
src/main/java/com/backend/allreva/rent/command/application/request/RentRegisterRequest.java:71
- [nitpick] Consider renaming 'rentBoardingDateRequests' to 'rentBoardingInfoRequests' for consistency with the updated domain model.
List<RentBoardingInfo> rentBoardingInfos = rentBoardingDateRequests.stream()
연결된 issue 🌟
구현 내용 📢
1. 역정규화 진행
차량 대절 신청 인원에 대해 역정규화를 진행했습니다.
더이상
RentJoin을SUM(passenger_num)할 필요 없이, 바로RentBoardingInfo테이블에서passenger_count를 조회하면 됩니다.2. 테이블 이름 수정
3. 쿼리 개선
rent와rent_boarding_info,rent_join인 간JOIN하는 과정에서 병목 현상을 발견했습니다.이에 제대로 식별자를 통해 구분할 수 있도록 JOIN 조건 절을 수정했습니다.
4. 인덱스 추가
rent_joinmember_id 인덱스 추가rent_boarding_info(rent_id, date) 인덱스 추가성능 개선을 통해 100만개 테스트 데이터 기준, 1분 이상 걸리던 조회가 약 200ms로 줄었습니다~
테스트 결과 🧩
정상 동작합니다~
리뷰 포인트 📌