Ativar a filtragem adaptativa no AlloyDB para PostgreSQL
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Nesta página, descrevemos a filtragem adaptativa no AlloyDB.
A filtragem adaptativa analisa padrões de consulta e distribuições de dados durante a execução da consulta para escolher dinamicamente a estratégia de filtragem mais eficiente, como filtragem inline ou pré-filtragem.
O otimizador de consultas do AlloyDB usa a análise baseada em custos para determinar se a filtragem inline ou a pré-filtragem oferece o melhor desempenho em qualquer ponto durante a execução da consulta.
Essa otimização é benéfica para as pesquisas vetoriais filtradas do AlloyDB, em que a filtragem adaptativa alterna automaticamente entre o uso de vetores e índices de metadados para garantir resultados eficientes e precisos sem a sua intervenção manual.
Quando a filtragem adaptativa aciona uma alteração da filtragem inline para a pré-filtragem durante a execução, o plano de consulta é alterado dinamicamente.
Por exemplo, o plano pode mostrar Bitmap assisted pre-filtering no campo Estratégia de Execução quando o otimizador determina que a pré-filtragem é mais eficiente naquele ponto da consulta. Essa alteração dinâmica ocorre à medida que o sistema se adapta aos dados reais encontrados durante a execução da consulta.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-30 UTC."],[],[],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)"]]