Skip to content

Conversation

@yooooonshine
Copy link
Member

issue

구현 의도

  • 데이터를 50만개를 넣고 성능 테스트를 해본 결과 성능이 크게 떨어짐을 알 수 있었다. 이를 해결해보고자 한다.

구현 사항

문제상황

  • 게시글 목록 성능 최적화를 했음에도 불구하고, 데이터가 쌓일수록 성능이 크게 저하됨을 알게 됨.
  • 50만 개의 데이터를 넣고 테스트해본 결과, 평균 응답 시간이 대폭 증가함.

해결과정

  • 문제의 원인을 분석한 결과, 데이터베이스 테이블에 Index가 없어서 조회 시 전체 테이블 스캔(Full Table Scan)이 발생하는 것이 주요 원인임을 확인
  • 게시글 조회 쿼리에서 자주 사용되는 조건문과 정렬 기준에 맞는 적절한 Index를 설계하고 적용

성과

  • AWS t2.micro 기준 1명의 유저에 대한 응답시간이 1.8s → 0.6s로 대략 3배 정도 개선
  • AWS t2.micro 기준 1000명의 유저에 대한 평균 응답시간이 110s → 4s로 대략 25배 개선

image

@yooooonshine yooooonshine linked an issue Jan 7, 2025 that may be closed by this pull request
2 tasks
@yooooonshine yooooonshine merged commit f11f732 into develop Jan 7, 2025
1 check failed
@yooooonshine yooooonshine deleted the feature/100-implement-indexing branch January 7, 2025 00:05
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.

Feature: 인덱싱을 통한 쿼리 최적화

2 participants