Skip to content

[Perf] Exact Seq Scan 기준선과 데이터 규모별 HNSW 성능·Recall 비교 - #132

Merged
Gimini-3 merged 4 commits into
developfrom
feature/131
Aug 8, 2026
Merged

[Perf] Exact Seq Scan 기준선과 데이터 규모별 HNSW 성능·Recall 비교#132
Gimini-3 merged 4 commits into
developfrom
feature/131

Conversation

@Gimini-3

@Gimini-3 Gimini-3 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

🔍️ 작업 내용

  • Closes Exact Seq Scan 기준선과 데이터 규모별 HNSW 성능·Recall 비교 추가 #131
  • PostgreSQL 17 + pgvector 0.8.1에서 Exact Seq Scan과 HNSW Index Scan을 같은 입력으로 비교하는 전용 Benchmark를 추가했습니다.
  • 2,000 / 10,000 / 50,000개의 1024차원 Vector를 고정 Seed로 생성합니다.
  • 실행 계획, p50·p95·p99·최대 지연, Recall@10, HNSW 구축 시간과 TOAST 포함 저장 공간을 JSON으로 기록합니다.
  • 무거운 측정은 vectorSearchPerformanceTest로 일반 테스트와 분리했습니다.
  • 상세 설계와 실제 로컬 측정 결과를 문서화했습니다.

✨ 주요 결과

Vector 수 Exact p95 HNSW p95 p95 배율 평균 Recall@10
2,000 5.103 ms 1.139 ms 4.48배 0.96
10,000 25.874 ms 2.015 ms 12.84배 0.52
50,000 197.611 ms 1.994 ms 99.09배 0.22

속도 이점과 함께 기본 ef_search=40의 Recall 저하도 확인했습니다. 이 PR은 수치를 숨기거나 임계값으로 고정하지 않고, 실제 Corpus·파라미터별 후속 비교가 필요하다는 경계를 기록합니다.

🧭 설계 경계

  • Exact 경로: Index Scan·Bitmap Scan 비활성화, Seq Scan 확인
  • HNSW 경로: Seq Scan 비활성화, 전용 HNSW Index Scan 확인
  • HNSW: m=16, ef_construction=64, ef_search=40
  • Random Vector 기반 Synthetic 기준선
  • 공식 OpenSQL 원격 성능·운영 SLO·파라미터 전체 탐색은 제외
  • 생성 JSON과 원시 Vector는 Git에 포함하지 않음

✅ 검증

  • Benchmark 계약 단위 테스트: 5 passed
  • 2,000·10,000 Smoke: PASS, 21초
  • 정식 3 Profile: PASS, 5분 25초
  • TOAST 포함 용량 수정 후 정식 재측정: PASS, 5분 36초
  • 전체 Java 회귀: 717 tests, failures/errors/skipped 0
  • git diff --check: PASS

💬 리뷰 요구사항

  • Exact와 HNSW Planner 강제 설정의 격리 경계가 적절한지 확인 부탁드립니다.
  • 기본 ef_search=40의 Recall 결과를 후속 튜닝 근거로 해석한 것이 적절한지 확인 부탁드립니다.
  • pg_table_size·pg_relation_size(index)·pg_total_relation_size 구분이 결과 문서에서 명확한지 확인 부탁드립니다.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Gimini-3, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 5 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2d50fb39-a2ba-43bb-8dc0-061c6a8f372a

📥 Commits

Reviewing files that changed from the base of the PR and between 4bedc10 and 5459e1f.

📒 Files selected for processing (5)
  • build.gradle
  • docs/design/gimin-#131-hnsw-exact-scale-benchmark.md
  • docs/test-results/gimin-#131-hnsw-exact-scale-benchmark.md
  • src/test/java/com/opensource/docgrid/domain/search/benchmark/VectorSearchPerformanceBenchmark.java
  • src/test/java/com/opensource/docgrid/domain/search/benchmark/VectorSearchPerformanceBenchmarkTest.java

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Gimini-3
Gimini-3 merged commit 2809282 into develop Aug 8, 2026
1 check passed
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.

Exact Seq Scan 기준선과 데이터 규모별 HNSW 성능·Recall 비교 추가

1 participant