Skip to content

Conversation

@kjy2844
Copy link
Contributor

@kjy2844 kjy2844 commented Dec 28, 2025

홈 게시글 정렬 조건 추가
: order_by(flag_col, random_order, Post.id.desc())

새로고침해서 cursor가 없다면 -> 새 seed 생성
cursor가 존재하면 FeedCursor에 있는 seed 사용 -> 같은 seed를 이용해서 순서 보장

이렇게 하는 방식이 간단하긴 한데, 성능이 안좋은 것 같아서 홈 게시글 조회 관련해서는 좀 더 봐야할것같습니다.

@kjy2844 kjy2844 requested a review from sehooh5 December 28, 2025 12:45
@sehooh5
Copy link
Contributor

sehooh5 commented Dec 28, 2025

확인했습니다. 지금 방법으로 merge하시죠!

게시물 수가 많을 때 성능 이슈가 생길 수 있다는것 같은데 맞을까요?
order 앞에 where 문에서 끊어주는 방법도 있다는것 같은데, 추천, 랜덤관련한 좋은 예제 있으면 찾아보겠습니다.

@kjy2844 kjy2844 merged commit fef14ed into dev Jan 4, 2026
2 checks passed
@kjy2844 kjy2844 deleted the feature/home-random-seed branch January 4, 2026 05:35
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.

3 participants