This topic describes the types of vector indexes supported by OceanBase Database.
Index types
OceanBase Database supports dense vector indexes, including HNSW and IVF series. For ease of reading, the following sections refer to dense vector indexes as dense indexes.
| Index type | Description |
|---|---|
| HNSW | The maximum dimension of an index column is 4096. An HNSW index is an in-memory index that must be fully loaded into memory. |
| HNSW_SQ | An HNSW_SQ index provides similar construction speed, search performance, and recall rate as an HNSW index, but uses only 1/2 to 1/3 of the memory. |
| HNSW_BQ | An HNSW_BQ index has a slightly lower recall rate than an HNSW index but significantly reduces memory usage. The BQ quantization compression algorithm (Rabitq) compresses vectors to 1/32 of their original size. As the dimension of a vector increases, the memory optimization effect of an HNSW_BQ index becomes more pronounced. |
| IVF | An IVF index implemented based on a database table does not occupy resident memory. |
| IVF_PQ | An IVF_PQ index implemented based on a database table does not occupy resident memory. It applies the PQ quantization technique to an IVF index, resulting in a slightly lower recall rate but higher performance than an IVF index. The PQ quantization compression algorithm can compress vectors to 1/16 to 1/32 of their original size in most scenarios. |
Considerations
- Distance algorithms: Dense vector indexes support L2, inner product (IP), and cosine distance as index distance algorithms.
- Distance functions: Vector index search supports calling some distance functions. For more information, see Use SQL functions.
- Filter conditions: Vector search supports filter conditions. The filter conditions can be scalar conditions or spatial relationships, such as ST_Intersects. Multi-value indexes, full-text indexes, and global indexes cannot be used as pre-filterers.
- Hybrid search: You can create a vector index and a full-text index in the same table.
- Offline DDL: For information about whether vector indexes support offline DDL operations, see Offline DDL.
- Columnstore indexes: Columnstore vector indexes are not supported in the current version.