-
Notifications
You must be signed in to change notification settings - Fork 0
[YS-440] chore: experiment_post 테이블 인덱스 추가 작업
#139
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
Conversation
…createdat` for query optimization
Walkthrough이번 변경 사항은 데이터베이스 마이그레이션 스크립트를 통해 Changes
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 30th. To opt out, configure Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
experiment_post 테이블 조회 최적화를 위한 인덱스 추가 작업experiment_post 테이블 조회 최적화를 위한 인덱스 추가 작업
experiment_post 테이블 조회 최적화를 위한 인덱스 추가 작업experiment_post 테이블 조회 최적화를 위한 인덱스 추가 작업
experiment_post 테이블 조회 최적화를 위한 인덱스 추가 작업experiment_post 테이블 조회 최적화를 위한 인덱스 추가 작업
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
infrastructure/src/main/resources/db/migration/V202505220014__add_index_recruit_status_end_date_and_created_at.sql (1)
1-2: 인덱스 추가 적절성 및 운영 환경 고려
experiment_post테이블의recruit_status+end_date,recruit_status+created_at복합 인덱스 추가는 조회 및 정렬 성능을 크게 향상시킵니다.- 다만 중복 인덱스가 없는지 확인하고, 이미 유사한 인덱스(단일 컬럼 인덱스 등)가 존재하지 않는지 검증해 주세요.
- PostgreSQL 사용 시 서비스 중단을 최소화하기 위해
CREATE INDEX CONCURRENTLY옵션을,
MySQL 사용 시ALGORITHM=INPLACE, LOCK=NONE옵션을 활용하는 방안을 고려하면 더욱 안전합니다.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
infrastructure/src/main/resources/db/migration/V202505220014__add_index_recruit_status_end_date_and_created_at.sql(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
experiment_post 테이블 조회 최적화를 위한 인덱스 추가 작업experiment_post 테이블 조회 최적화를 위한 인덱스 추가 작업
experiment_post 테이블 조회 최적화를 위한 인덱스 추가 작업experiment_post 테이블 인덱스 추가 작업
chock-cho
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
안녕하세요! 지수님 작업 잘 봤어요,,
제 작업이었는데 놓친 부분이었었네요 🥺인덱스 잘 반영해주셔서 감사합니다 🙌
두 복합 인덱스 모두 쿼리 목적에 맞게 잘 설계된 같다는 의견이에요.
filesort 없이 정렬 처리된 점이 좋아보이는데요.
한 가지 궁금한 점이 있는데요!
실행 계획에서 Backward Index Scan이 사용된 걸 처음 봐서요 👀
혹시 일반 Index Scan과 어떤 차이가 있는지, 실제 쿼리 정렬에서 어떤 이점이 있는 건지 간단히 설명해주실 수 있을까요?
(구글링은 해봤는데 감이 잘 안 잡혀서요..! 😅)
좋은 작업 잘봤습니다!
실행 계획에서 인덱스는 기본적으로 오름차순으로 정렬되어 있기 때문에, 제가 실행 계획에서 내림차순 정렬 조건으로 조회를 시도한 것처럼 |
* [YS-415] feature: 연구자 회원 가입 - 인증 번호 메일 전송 시, 요청 횟수 반환 추가 (#137) * refactor: add requestCount field to notify users of request limit * fix: resolve CI ktlintCheck fail * hotfix: fix ktlintCheck failure by formatting code * [YS-418] fix: 연구자 회원가입 이메일 인증 완료 시, 누락된 인증 요청 횟수 초기화 로직 추가 (#138) * [YS-440] chore: experiment_post 테이블 인덱스 추가 작업 (#139) * [YS-457] hotfix: ktlint 버전 문제로 gradle ktlintCheck 방식으로 변경 (#141) * [YS-459] hotfix: 지역 공고 전체 개수 조회 API 오류 해결 (#142) * fix: compute total post count for _ALL area based on sub-areas * test: update tests to reflect _ALL area total count fix * refactor: refactor area count logic for better readability --------- Co-authored-by: Sujung Shin <113707388+chock-cho@users.noreply.github.com> Co-authored-by: 베뉴 <christer10@ewhain.net>
💡 작업 내용
recruit_status,end_date복합 인덱스 생성recruit_status가true인 게시글 중에서end_date기준으로 필터링하는 쿼리의 성능을 개선하기 위해 추가recruit_status,created_at복합 인덱스 생성recruit_status가true인 게시글을created_at기준으로 정렬하는 쿼리에서 성능 향상을 노리기 위해 추가실행 계획 결과
idx_post_status_enddateidx_post_status_createdat✅ 셀프 체크리스트
🙋🏻 확인해주세요
🔗 Jira 티켓
https://yappsocks.atlassian.net/browse/YS-440
Summary by CodeRabbit