토너먼트 초대코드 조회 풀스캔 제거 (active_invite_code 인덱스 활용)#698
Conversation
초대 참여·프리뷰(hot path)의 초대코드 조회가 base 컬럼 invite_code 로 필터해 tournaments 풀스캔이 됐다. 유니크 인덱스는 generated STORED 컬럼 active_invite_code(= IF(deleted_at IS NULL, invite_code, NULL))에만 걸려 있어, MySQL 8 이 base 컬럼 조건에 이 인덱스를 못 쓰기 때문. 조회를 active_invite_code = ? 기준으로 전환한다. 삭제행은 이 컬럼이 NULL 이라 deleted_at IS NULL 조건도 자연 흡수된다. 컬럼을 엔티티에 read-only 로만 매핑하고 derived query 를 유지해 마이그레이션 0, 타입 안전을 지킨다. EXPLAIN 실측: type ALL(rows 1999) -> const(uk_tournaments_active_invite_code).
|
Discord 스레드 연동용 메타데이터입니다. discord-pr-bot 워크플로가 자동 생성하며, 수정·삭제하면 PR 과 Discord 알림 연동이 끊깁니다. |
|
Warning Review limit reached
Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai full review |
✅ Action performedFull review finished. Your plan includes PR reviews subject to rate limits. More reviews will be available in 43 minutes. |
|
@coderabbitai full review |
Action performedFull review triggered. |
✅ Action performedFull review finished. Your plan includes PR reviews subject to rate limits. More reviews will be available in 57 minutes. |
Situation
Task
Action
insertable=false, updatable=false)하고, 조회는 기존과 같은 파생 쿼리(findFirstByActiveInviteCode,existsByActiveInviteCode)로 유지했다. 배선은 repository 계층 두 파일만 바뀐다.구현 방식 결정 — native 쿼리 대신 파생 쿼리
파생 컬럼을 조회하는 두 갈래를 저울질했다.
@Query(nativeQuery=true))@Query를 잠금/수정에만 씀)파생 쿼리는 부팅 시점에 프로퍼티 경로가 검증되어 오타나 컬럼 변경이 곧바로 드러난다. 이 레포가 파생 쿼리를 기본으로 쓰는 점과도 맞아, 엔티티에 읽기 전용 매핑 하나를 더하는 비용을 감수하고 이쪽을 택했다.
Result
invite_code = ? AND deleted_at IS NULL)active_invite_code = ?)연관 이슈
Summary by CodeRabbit
기능 개선
버그 수정
400 Bad Request가 반환되도록 수정되었습니다.