Skip to content
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

[BE] 스터디 목록 조회에 커서 기반 페이징을 적용 #467

Open
tco0427 opened this issue Oct 31, 2022 · 0 comments · May be fixed by #468
Open

[BE] 스터디 목록 조회에 커서 기반 페이징을 적용 #467

tco0427 opened this issue Oct 31, 2022 · 0 comments · May be fixed by #468
Assignees
Labels
🖥 backend New backend feature 🚀 feature New feature or request 🛠 refactoring Refactor code

Comments

@tco0427
Copy link
Collaborator

tco0427 commented Oct 31, 2022

요약

커서 기반 페이징 적용하기

세부 설명

현재 offset 기반의 페이징의 경우 예를 들어 50,000 ~ 50,005 번째의 5개의 데이터를 조회해오기 위해서는 DB 디스크에서 50,005 개의 데이터를 모두 읽어와야하며 디스크를 읽을 때 랜덤I/O 가 발생해 성능상 문제가 많습니다.
이를 해결하기 위한 방법인 커서 기반의 페이징을 적용하여 50,000 ~ 50,005 번째의 5개의 데이터를 조회해오더라도 필요한 데이터인 5개만 디스크로 부터 읽어올 수 있도록 개선합니다.
우선은 가장 빈번한 조회가 일어나는 메인 페이지의 study 목록 조회에 대해서 적용합니다.

참고 : 커서 기반 페이지네이션 (Cursor-based Pagination) 구현하기
참고 : Faster Pagination in Mysql – Why Order By With Limit and Offset is Slow?

@tco0427 tco0427 added 🚀 feature New feature or request 🖥 backend New backend feature 🛠 refactoring Refactor code labels Oct 31, 2022
@tco0427 tco0427 self-assigned this Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖥 backend New backend feature 🚀 feature New feature or request 🛠 refactoring Refactor code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant