[Refactor] 산 이름/주소 검색에 pg_trgm GIN 인덱스 적용 - #395
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
📊 테스트 커버리지 리포트
|
🧾 요약
LIKE '%keyword%')이 인덱스 없이 풀스캔하던 문제 개선 — 자유게시판(V13)과 동일한 pg_trgm GIN 인덱스 패턴 적용🔗 이슈
✨ 변경 내용
V42__add_mountain_search_index.sql추가 —mountains.name/address에pg_trgmGIN 인덱스 생성searchByKeyword/searchByKeywordAll/searchByKeywordAndVisibility3곳 모두 이미LIKE '%keyword%'라 인덱스만 생기면 planner가 알아서 사용📊 측정 결과 (로컬 Postgres, 더미 산 10만 건 + 매칭 15건 시딩 후 트랜잭션 롤백)
관악)관악산)pg_trgm의 최소 trigram 단위가 3글자라 2글자 검색어는 인덱스 선택성이 낮아 오히려 느려질 수 있음 — 다만 planner가 자동으로 유리한 쪽(이 경우 Seq Scan)을 선택하므로 애플리케이션 동작에는 문제없음.
✅ 확인