Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini memberikan ringkasan konseptual tentang cara meningkatkan performa kueri vektor dengan Indeks ScaNN.
Indeks ScaNN menggunakan pengindeksan berbasis kuantisasi pohon. Dalam teknik kuantisasi
pohon, indeks mempelajari hierarki penelusuran bersama dengan fungsi kuantisasi (atau
hashing). Saat Anda menjalankan kueri, hierarki penelusuran digunakan untuk memangkas
ruang penelusuran, sedangkan kuantisasi digunakan untuk mengompresi ukuran indeks. Pemangkasan ini
mempercepat penskoran kemiripan (yaitu, jarak) antara vektor kueri
dan vektor database.
Untuk mencapai kecepatan kueri per detik (QPS) yang tinggi
dan recall yang tinggi dengan kueri nearest neighbor, Anda harus mempartisi
hierarki indeks ScaNN dengan cara yang paling sesuai untuk data
dan kueri Anda.
Karakteristik umum dari generasi model penyematan berdimensi tinggi saat ini adalah model tersebut masih dapat mempertahankan banyak informasi dengan dimensi yang jauh lebih rendah, misalnya 90% informasi dapat dipertahankan hanya dengan 20% dimensi penyematan. Untuk membantu mempercepat set data tersebut, AlloyDB ScaNN akan otomatis melakukan pengurangan dimensi menggunakan Analisis Komponen Utama (lihat scann.enable_pca di bawah) pada vektor yang diindeks, yang lebih lanjut akan mengurangi penggunaan CPU & memori untuk penelusuran vektor. Karena pengurangan dimensi masih menyebabkan kehilangan recall kecil dalam indeks, AlloyDB ScaNN akan melakukan kompensasi melalui langkah peringkat awal dengan jumlah kandidat vektor PCA yang lebih besar dari indeks, lalu memberi peringkat ulang berdasarkan vektor asli (lihat scann.pre_reordering_num_neighbors).
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-25 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)."]]