alloydb_scann
alloydb_scann · AlloyDB ScaNN extension for approximate nearest-neighbor vector indexes.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100951 | alloydb_scann | alloydb_scann | - | RAG | Unknown | C |
PostgreSQL · 14, 15, 16, 17
| Relationships | |
|---|---|
| Requires | vector |
Usage
Sources:
alloydb_scann is Google AlloyDB’s managed ScaNN access method for approximate nearest-neighbor searches over vector columns. Use it when vector search latency, index build time, or memory footprint matters more than exact-neighbor guarantees. It is available in AlloyDB and AlloyDB Omni, not as a portable community PostgreSQL extension.
Core Workflow
Install the managed extension; CASCADE installs the required vector extension when necessary:
Create an automatically tuned cosine-distance index and run a matching nearest-neighbor query:
The indexed distance function and query operator must represent the same metric. ScaNN supports l2, dot_product, and cosine. A simple USING scann definition uses automatic tuning and maintenance by default.
Index Modes and Options
mode='AUTO'lets AlloyDB choose and maintain the tree structure.optimization='SEARCH_OPTIMIZED'favors recall and latency;BALANCEDreduces build cost.auto_maintenance='ON'is the automatic-mode default and keeps the index adapted as data changes.mode='MANUAL'exposes settings such asnum_leaves,quantizer, andmax_num_levels; use it only after measuring recall and latency on representative queries.- Quantizers include
SQ8andFLAT; additional choices and deeper trees can be preview features with separate instance flags.
Requirements and Caveats
The source table needs stored vector embeddings. Empty, nearly empty, and partitioned tables have special creation constraints; automatically tuned indexes on tables with fewer than 10,000 rows require deferred index creation. Approximate results require application-level recall testing, and index build or maintenance consumes instance resources.
Version availability, supported PostgreSQL majors, preview flags, privileges, upgrades, and maintenance behavior are controlled by the AlloyDB service. Check the provider documentation for the target instance rather than assigning a community extension version.