받은 신청 리스트에서 생성한 더미데이터 활용
관련 링크 - https://tough-echinacea-3e3.notion.site/607af5f3e8ee4ecca1b87256867d4919?pvs=4
테스트 코드 (특정 회원이 받은 신청 리스트 조회)
회원 ID = 15000 → (DB 데이터 기준 (9개의 신청을 한 유저)
@Test
@DisplayName("요청한 신청 리스트 조회 쿼리 성능 테스트")
void request_application_test() {
List<ApplicationRequestedDto> requestedListByMemberId = applicationService.getRequestedListByMemberId(15000L);
for (ApplicationRequestedDto applicationRequestedDto : requestedListByMemberId) {
System.out.println(applicationRequestedDto.toString());
}
}
결과
2023-07-01 11:56:11.241 INFO 22704 --- [ main] p6spy : [statement] | 20 ms |
select
applicatio0_.application_id as col_0_0_,
applicatio0_.recruitment_id as col_1_0_,
recruitmen1_.title as col_2_0_,
gym3_.name as col_3_0_,
recruitmen1_.started_at as col_4_0_,
recruitmen1_.member_id as col_5_0_,
member7_.profile_url as col_6_0_,
member7_.nickname as col_7_0_,
member7_.gender as col_8_0_,
applicatio0_.status as col_9_0_,
applicatio0_.created_at as col_10_0_
from
application applicatio0_ cross
join
recruitment recruitmen1_ cross
join
gym gym3_ cross
join
member member7_
where
applicatio0_.recruitment_id=recruitmen1_.recruitment_id
and recruitmen1_.gym_id=gym3_.gym_id
and recruitmen1_.member_id=member7_.member_id
and applicatio0_.member_id=15000
and (
applicatio0_.status='WAITING'
or applicatio0_.status='SUCCESS'
and recruitmen1_.started_at<='2023-07-02T11:56:11.008+0900'
)
and recruitmen1_.started_at>='2023-07-01T11:56:11.008+0900'
order by
applicatio0_.created_at desc
2023-07-01 11:56:11.256 INFO 22704 --- [ main] p6spy : [commit] | 0 ms |
ApplicationRequestedDto(applicationId=2769, recruitmentId=139, title=, gym=ccijtqxstsimmxb, startedAt=2023-09-19T06:33:58, memberId=28, profileUrl=xxxxxx, nickname=test28, gender=남성, status=WAITING, applicationDate=null)
ApplicationRequestedDto(applicationId=20787, recruitmentId=1040, title=, gym=umcyowszspxtauw, startedAt=2023-09-17T07:50:49, memberId=208, profileUrl=xxxxxx, nickname=test208, gender=남성, status=WAITING, applicationDate=null)
ApplicationRequestedDto(applicationId=59452, recruitmentId=2973, title=, gym=yhpeapzdqwiaese, startedAt=2023-09-01T05:52:19, memberId=595, profileUrl=xxxxxx, nickname=test595, gender=남성, status=WAITING, applicationDate=null)
ApplicationRequestedDto(applicationId=183288, recruitmentId=9165, title=, gym=yeegvjgfjeumzlh, startedAt=2023-09-08T23:26:20, memberId=1833, profileUrl=xxxxxx, nickname=test1833, gender=남성, status=WAITING, applicationDate=null)
ApplicationRequestedDto(applicationId=262028, recruitmentId=13102, title=, gym=osylmasmicnjhka, startedAt=2023-09-04T11:17:06, memberId=2621, profileUrl=xxxxxx, nickname=test2621, gender=남성, status=WAITING, applicationDate=null)
ApplicationRequestedDto(applicationId=358594, recruitmentId=17930, title=, gym=xtxkerxklwcvvqr, startedAt=2023-07-20T22:04:54, memberId=3586, profileUrl=xxxxxx, nickname=test3586, gender=남성, status=WAITING, applicationDate=null)
ApplicationRequestedDto(applicationId=398796, recruitmentId=19940, title=, gym=kmdftztvwxyxrts, startedAt=2023-07-22T07:21:28, memberId=3988, profileUrl=xxxxxx, nickname=test3988, gender=남성, status=WAITING, applicationDate=null)
ApplicationRequestedDto(applicationId=413314, recruitmentId=20666, title=, gym=xnumasmeoegsutm, startedAt=2023-08-25T06:10:30, memberId=4134, profileUrl=xxxxxx, nickname=test4134, gender=남성, status=WAITING, applicationDate=null)
ApplicationRequestedDto(applicationId=463597, recruitmentId=23180, title=, gym=kbfvnehytavznpk, startedAt=2023-07-13T22:07:54, memberId=4636, profileUrl=xxxxxx, nickname=test4636, gender=남성, status=WAITING, applicationDate=null)
분석