Skip to content

Conversation

@rinarina0429
Copy link
Member

@rinarina0429 rinarina0429 commented Mar 21, 2025

Related Issue

Key Changes

  • 차단 유저의 피드는 오늘의 발견에 뜨지 않도록 하였습니다.
    • 인기작의 가장 인기있는 피드가 차단한 유저의 피드일 경우 -> 다음으로 인기있는 피드 보여줌
    • 가장 있기 있는 피드가 차단한 유저의 피드 && 작품의 피드가 그거 하나 뿐이라면 -> 작품 소개 보여줌
  • 원래 비로그인 시에도 호출하는 API이기 때문에, Principal이 null인 경우도 처리해주었습니다.
  • findPopularFeedsByNovelIds() 함수에서 쿼리 최적화를 진행해보았습니다.
    • 기존에는 novelId마다 쿼리를 날렸었기 때문에, 작품 개수에 따라 쿼리가 많아지지 않도록 한번에 쿼리를 날리는 방식으로 수정하였습니다.
    • 이 과정에서 findPopularFeedsByNovelIds()에서 바로 Map을 반환하게 하여 createFeedMap() 함수를 제거했습니다.

To Reviewers

References

@rinarina0429 rinarina0429 self-assigned this Mar 21, 2025
@github-actions github-actions bot requested a review from ChaeAg March 21, 2025 01:01
Comment on lines -26 to -32
.map(novelId -> jpaQueryFactory
.selectFrom(feed)
.leftJoin(feed.likes, like)
.where(feed.novelId.eq(novelId))
.groupBy(feed.feedId)
.orderBy(like.count().desc())
.fetchFirst())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기존에는 novelId마다 쿼리가 발생함

Copy link
Member

@ChaeAg ChaeAg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 쿼리 최적화를 진행하셨군요! 멋진데요? 테스트 해보셨을때 결과는 어땠나요 ㅎㅎ 많이 좋아졌나요?

@rinarina0429 rinarina0429 requested a review from Kim-TaeUk March 23, 2025 07:28
Copy link
Member

@Kim-TaeUk Kim-TaeUk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요거 인증인가 리팩터링한거 반영되면 수정해서 붙이죠!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] 오늘의 발견 API 리팩토링

4 participants