[[["易于理解","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-09-04。"],[],[],null,["# Activate adaptive filtering in AlloyDB for PostgreSQL\n\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| You can process personal data for this feature as outlined in the\n| [Cloud Data Processing\n| Addendum](/terms/data-processing-addendum), subject to the obligations and restrictions described in the agreement under\n| which you access Google Cloud.\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis page describes adaptive filtering in AlloyDB.\n| **Note:** Inline filtering is supported only when you use the ScaNN algorithm. Inline filtering is not compatible with the Inverted File (IVF), Inverted File Flat (IVFFlat), or Hierarchical Navigable Small Worlds (HNSW) algorithms.\n\nAdaptive filtering analyzes query patterns and data distributions during query execution to dynamically choose the most efficient filtering strategy such as inline or pre-filtering.\n\nThe AlloyDB query optimizer uses cost-based analysis to determine whether inline filtering or pre-filtering provides the best performance at any given point during query execution.\n\nSuch optimization is beneficial for AlloyDB's filtered vector searches, where adaptive filtering automatically switches between vector and metadata index usage to ensure efficient and accurate results without your manual intervention.\n\nEnable adaptive filtering\n-------------------------\n\nTo enable adaptive filtering, use the [`scann.enable_preview_features`](/alloydb/docs/reference/alloydb-flags#scann.enable_preview_features) flag.\n\nWhen adaptive filtering triggers a switch from inline filtering to pre-filtering during execution, the query plan dynamically changes.\n\nFor example, the plan can show `Bitmap assisted pre-filtering` in the **Execution Strategy** field when the optimizer determines that pre-filtering is more efficient at that point in the query. This dynamic change occurs as the system adapts to the actual data that it encounters during the query's execution. \n\n Limit (actual rows=10 loops=1)\n -\u003e Custom Scan (vector scan) on t1 (actual rows=10 loops=1)\n Execution Strategy: Bitmap assisted pre-filtering\n Order By: (vec_col \u003c=\u003e '[...]'::vector)\n Limit: 10\n Num Requalifications: 0\n Num filtered: 1000\n -\u003e Bitmap Index Scan on btree_idx (actual rows=10000 loops=1)\n Index Cond: (int_col \u003c= 100000000)\n\nWhat's next\n-----------\n\n- [Filtered vector search in AlloyDB](/alloydb/docs/ai/filtered-vector-search-overview)"]]