値を大きくすると再現率は高くなりますが、QPS は低くなります。並べ替えを無効にするには、この値を 0 に設定します。インデックスの作成時に PCA が有効になっていない場合、デフォルトは 0 です。それ以外の場合は、デフォルトは 50 x K です。ここで、K はクエリで指定された LIMIT です。
クエリ ランタイム (省略可)
scann.num_search_threads
マルチスレッド検索の検索スレッド数。これにより、レイテンシの影響を受けやすいアプリケーションで ScaNN ANN 検索に複数のスレッドを使用することで、単一クエリのレイテンシを短縮できます。データベースがすでに CPU バウンドになっている場合、この設定では単一クエリのレイテンシは改善されません。デフォルト値は 2 です。
[[["わかりやすい","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\u003eThis document provides reference information for tuning parameters related to the ScaNN Index, focusing on optimizing recall and queries per second (QPS).\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003emax_num_levels\u003c/code\u003e parameter determines the K-means clustering tree's depth, with values of 1 or 2 corresponding to two-level or three-level tree indexes, respectively, and is influenced by the total number of vector rows.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003enum_leaves\u003c/code\u003e parameter, which dictates the number of index partitions, impacts performance, and its optimal value is calculated based on the number of vector rows, with different formulas for two-level and three-level indexes.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003equantizer\u003c/code\u003e parameter selects the quantization method, defaulting to \u003ccode\u003eSQ8\u003c/code\u003e for balanced performance, but can be set to \u003ccode\u003eFLAT\u003c/code\u003e when higher recall rates are needed.\u003c/p\u003e\n"],["\u003cp\u003eDatabase flags like \u003ccode\u003escann.num_leaves_to_search\u003c/code\u003e and \u003ccode\u003escann.pre_reordering_num_neighbors\u003c/code\u003e allow trading off recall and QPS, while \u003ccode\u003escann.num_search_threads\u003c/code\u003e can help reduce single query latency in CPU-bound scenarios by using multiple threads.\u003c/p\u003e\n"]]],[],null,["# ScaNN index reference\n\nSelect a documentation version: 16.3.0keyboard_arrow_down\n\n- [Current (16.8.0)](/alloydb/omni/current/docs/reference/scann-index-reference)\n- [16.8.0](/alloydb/omni/16.8.0/docs/reference/scann-index-reference)\n- [16.3.0](/alloydb/omni/16.3.0/docs/reference/scann-index-reference)\n- [15.12.0](/alloydb/omni/15.12.0/docs/reference/scann-index-reference)\n- [15.7.1](/alloydb/omni/15.7.1/docs/reference/scann-index-reference)\n- [15.7.0](/alloydb/omni/15.7.0/docs/reference/scann-index-reference)\n\n\u003cbr /\u003e\n\nThis page provides reference material for the ScaNN index.\n\n\u003cbr /\u003e\n\nTuning parameters\n-----------------\n\nThe following index parameters and database flags are used together to find the right balance of recall and QPS.\n\nOption type Index creation Query runtime \n\nWhat's next\n-----------\n\n- [Get started with vector embeddings using AlloyDB AI](https://codelabs.developers.google.com/alloydb-ai-embedding#0)."]]