Activate adaptive filtering in AlloyDB AI

This page provides instructions for enabling adaptive filtering in AlloyDB AI, a feature that optimizes filtered vector searches.

Enable adaptive filtering

To enable adaptive filtering, you must set the scann.enable_preview_features flag to on.

gcloud alloydb instances update INSTANCE_ID \
    --database-flags scann.enable_preview_features=on \
    --region=REGION \
    --cluster=CLUSTER_ID \
    --project=PROJECT_ID

Replace the following:

  • INSTANCE_ID: the ID of the instance where you want to enable adaptive filtering.
  • REGION: the region where your instance is located for example, us-central1.
  • CLUSTER_ID: the ID of the cluster where your instance is located.
  • PROJECT_ID: the ID of the project where your cluster is located.

Setting this flag to on activates the adaptive filtering behavior, allowing the query optimizer to dynamically switch between inline and pre-filtering strategies.

What's next