이 페이지에서는 ScaNN 색인을 사용하여 벡터 쿼리 성능을 개선하는 방법을 개념적으로 간략히 설명합니다.
ScaNN 색인은 트리 정규화 기반 색인을 사용합니다. 트리 정규화 기법에서 색인은 정규화 (또는 해싱) 함수와 함께 검색 트리를 학습합니다. 쿼리를 실행할 때 검색 트리는 검색 공간을 정리하는 데 사용되고, 정규화는 색인 크기를 압축하는 데 사용됩니다. 이렇게 프루닝하면 쿼리 벡터와 데이터베이스 벡터 간의 유사성 (즉, 거리) 점수를 더 빠르게 얻을 수 있습니다.
최근접 이웃 쿼리로 높은 QPS (초당 쿼리 수)와 높은 재현율을 모두 달성하려면 데이터와 쿼리에 가장 적합한 방식으로 ScaNN 색인의 트리를 분할해야 합니다.
현재의 고차원 임베딩 모델의 공통적인 특징은 훨씬 낮은 차원에서도 많은 정보를 유지할 수 있다는 것입니다. 예를 들어 임베딩의 20% 차원만으로도 정보의 90% 를 유지할 수 있습니다. 이러한 데이터 세트의 속도를 높이기 위해 AlloyDB ScaNN은 색인이 생성된 벡터에 대해 주요 구성요소 분석 (아래 scann.enable_pca 참고)을 사용하여 측정기준 축소를 자동으로 실행하여 벡터 검색의 CPU 및 메모리 사용량을 더욱 줄입니다. 크기 축소로 인해 색인에서 여전히 약간의 검색 실패가 발생하므로 AlloyDB 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)"],[[["\u003cp\u003eScaNN index employs tree-quantization to accelerate vector similarity scoring by pruning the search space and compressing index size.\u003c/p\u003e\n"],["\u003cp\u003eOptimal tree partitioning in ScaNN is crucial for achieving high query-per-second rates and recall in nearest-neighbor queries.\u003c/p\u003e\n"],["\u003cp\u003eAlloyDB ScaNN automatically reduces dimensionality using Principal Component Analysis (PCA) to enhance speed and minimize resource consumption for high-dimensional embedding datasets.\u003c/p\u003e\n"],["\u003cp\u003eAlloyDB ScaNN compensates for recall loss from PCA by initially ranking a larger pool of PCA'ed vector candidates and subsequently re-ranking them using the original vectors.\u003c/p\u003e\n"]]],[],null,["# ScaNN vector query performance overview\n\nThis page gives a conceptual overview of improving vector query performance with the ScaNN Index.\n\nScaNN index uses tree-quantization based indexing. In Tree-quantization\ntechniques, indexes learn a search tree together with a quantization (or\nhashing) function. When you run a 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 (i.e., distance) between the query vector\nand 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\nA common characteristic of the current generation of high-dimensional embedding models is they can still retain much of the information at much lower dimensionality, for example 90% of the information can be retained with only 20% of the embedding's dimensions. To help speed up such datasets, AlloyDB ScaNN will automatically perform dimension reduction using Principal Component Analysis (see `scann.enable_pca` below) on the indexed vectors which further reduces cpu \\& memory usage for the vector search. Because dimension reduction still causes minor recall loss in the index, AlloyDB ScaNN compensates through an initial ranking step with a larger number of PCA'ed vector candidates from the index then re-ranking them by the original vectors (see `scann.pre_reordering_num_neighbors`).\n\nWhat's next\n-----------\n\n- [Get started with vector embeddings using AlloyDB AI](https://codelabs.developers.google.com/alloydb-ai-embedding#0)."]]