Mengaktifkan pemfilteran adaptif di AlloyDB untuk PostgreSQL
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini menjelaskan pemfilteran adaptif di AlloyDB.
Pemfilteran adaptif menganalisis pola kueri dan distribusi data selama eksekusi kueri untuk memilih strategi pemfilteran yang paling efisien secara dinamis, seperti pemfilteran inline atau pra-pemfilteran.
Pengoptimal kueri AlloyDB menggunakan analisis berbasis biaya untuk menentukan apakah pemfilteran inline atau pra-pemfilteran memberikan performa terbaik pada titik tertentu selama eksekusi kueri.
Pengoptimalan ini bermanfaat untuk penelusuran vektor yang difilter AlloyDB, di mana pemfilteran adaptif secara otomatis beralih antara penggunaan indeks vektor dan metadata untuk memastikan hasil yang efisien dan akurat tanpa intervensi manual Anda.
Saat pemfilteran adaptif memicu peralihan dari pemfilteran inline ke pra-pemfilteran selama eksekusi, rencana kueri akan berubah secara dinamis.
Misalnya, rencana dapat menampilkan Bitmap assisted pre-filtering di kolom Strategi Eksekusi saat pengoptimal menentukan bahwa pra-pemfilteran lebih efisien pada titik tersebut dalam kueri. Perubahan dinamis ini terjadi saat sistem beradaptasi dengan data sebenarnya yang ditemuinya selama eksekusi kueri.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-03 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)"]]