[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-22。"],[[["\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)."]]