ScaNN 색인은 색인이 양자화 (또는 해싱) 함수와 함께 검색 트리를 학습하는 트리-양자화 기반 색인을 사용합니다. 쿼리를 실행하면 검색 트리가 검색 공간을 가지치기하는 데 사용되고 양자화는 색인 크기를 압축하는 데 사용됩니다. 이 가지치기를 통해 쿼리 벡터와 데이터베이스 벡터 간의 유사성(즉, 거리) 점수 매기기가 빨라집니다.
최근접 이웃 쿼리로 높은 초당 쿼리 수 (QPS)와 높은 재현율을 모두 달성하려면 데이터와 쿼리에 가장 적합한 방식으로 ScaNN 색인의 트리를 파티셔닝해야 합니다.
고차원 삽입 모델은 훨씬 낮은 차원에서 많은 정보를 유지할 수 있습니다. 예를 들어 삽입의 차원 중 20% 만으로 정보의 90% 를 유지할 수 있습니다. 이러한 데이터 세트의 속도를 높이기 위해 AlloyDB AI ScaNN 색인은 색인이 생성된 벡터에 주성분 분석(PCA)을 사용하여 차원 축소를 자동으로 실행하므로 벡터 검색의 CPU 및 메모리 사용량이 더욱 줄어듭니다. 자세한 내용은 scann.enable_pca를 참조하세요.
차원 축소로 인해 색인에서 약간의 재현율 손실이 발생하므로 AlloyDB AI ScaNN 색인은 먼저 색인에서 PCA 처리된 벡터 후보를 더 많이 사용하여 순위 지정 단계를 실행하여 재현율 손실을 보상합니다. 그런 다음 ScaNN은 PCA 처리된 벡터 후보의 순위를 원래 벡터에 따라 다시 지정합니다.
자세한 내용은 scann.pre_reordering_num_neighbors를 참조하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["Select a documentation version: 15.12.0keyboard_arrow_down\n\n- [Current (16.8.0)](/alloydb/omni/current/docs/ai/scann-vector-query-perf-overview)\n- [16.8.0](/alloydb/omni/16.8.0/docs/ai/scann-vector-query-perf-overview)\n- [16.3.0](/alloydb/omni/16.3.0/docs/ai/scann-vector-query-perf-overview)\n- [15.12.0](/alloydb/omni/15.12.0/docs/ai/scann-vector-query-perf-overview)\n- [15.7.1](/alloydb/omni/15.7.1/docs/ai/scann-vector-query-perf-overview)\n- [15.7.0](/alloydb/omni/15.7.0/docs/ai/scann-vector-query-perf-overview)\n\n\u003cbr /\u003e\n\nThis page provides a conceptual overview of improving vector query performance using AlloyDB AI's Scalable Nearest Neighbor (ScaNN) index. For more information, see [Create indexes and query vectors](/alloydb/omni/15.12.0/docs/ai/store-index-query-vectors?resource=scann).\n\n\u003cbr /\u003e\n\nThe ScaNN index uses tree-quantization-based indexing, in which indexes learn\na search tree together with a quantization (or hashing) function. When you run\na query, the search tree is used to prune the\nsearch space, while quantization is used to compress the index size. This pruning\nspeeds up the scoring of the similarity---in other words, the distance---between\nthe query vector and the database vectors.\n\nTo achieve both a high query-per-second rate (QPS)\nand a high recall with your nearest-neighbor queries, you must partition\nthe tree of your ScaNN index in a way that is most appropriate to your data\nand your queries.\n\nHigh-dimensional embedding models can retain much of the information at much\nlower dimensionality. For example, you can retain 90% of the information with\nonly 20% of the embedding's dimensions. To help speed up such datasets,\nthe AlloyDB AI ScaNN index automatically performs dimension reduction\nusing [Principal Component Analysis](https://en.wikipedia.org/wiki/Principal_component_analysis)\n(PCA) on the indexed vectors, which further reduces CPU and memory usage for\nthe vector search. For more information, see\n[`scann.enable_pca`](/alloydb/omni/15.12.0/docs/reference/scann-index-reference).\n\nBecause dimension reduction causes minor recall loss in the index, the\nAlloyDB AI ScaNN index compensates for recall loss\nby first performing a ranking\nstep with a larger number of PCAed vector candidates from the index. Then,\nScaNN re-ranks the PCAed vector candidates by the original vectors.\nFor more information, see [`scann.pre_reordering_num_neighbors`](/alloydb/omni/15.12.0/docs/reference/scann-index-reference).\n\nWhat's next\n\n- Learn [best practices for tuning ScaNN indexes](/alloydb/omni/15.12.0/docs/ai/best-practices-tuning-scann).\n- [Get started with vector embeddings using AlloyDB AI](https://codelabs.developers.google.com/alloydb-ai-embedding#0).\n- Learn more about the [AlloyDB AI ScaNN index](https://cloud.google.com/blog/products/databases/understanding-the-scann-index-in-alloydb?e=48754805)."]]