Vector index memory management
This topic describes how to estimate and manage the memory usage of all types of vector indexes in seekdb.
Configure vector index memory
Use vector_memory_limit to configure the memory limit for the vector module. The default value, 0M, sets the limit to 50% of effective memory. Effective memory is physical memory, capped by any finite cgroup memory limit. The following example sets a 4 GB vector memory limit.
ALTER SYSTEM SET vector_memory_limit = '4G';
For information about the instance memory budget and related configuration items, see Configure memory for seekdb.
Query index memory estimation and actual usage
You can use the DBMS_VECTOR system package to estimate the index memory usage:
- Before you create a table, you can call the INDEX_VECTOR_MEMORY_ADVISOR procedure to estimate the index memory usage.
- After you create a table and insert data, you can call the INDEX_VECTOR_MEMORY_ESTIMATE procedure to analyze the index memory usage.
The vector index memory estimation returns two pieces of information: the minimum memory configuration required to create the vector index, and the actual memory usage after the HNSW_SQ and IVF indexes are created.
For memory-sparse indexes, the IDX_TYPE parameter must be specified as SINDI (case-insensitive). Otherwise, the memory estimation cannot be performed.
Query oceanbase.V$OB_VECTOR_MEMORY for actual usage and the effective vector memory limit. The columns are in bytes.
| Column | Description |
|---|---|
VECTOR_MEM_HOLD | Memory held by the vector allocator plus memory used by vector index metadata. |
VECTOR_MEM_USED | Memory used by the vector allocator plus memory used by vector index metadata. |
VECTOR_MEM_LIMIT | The effective memory limit of the vector module. |
SELECT VECTOR_MEM_HOLD, VECTOR_MEM_USED, VECTOR_MEM_LIMIT FROM oceanbase.V$OB_VECTOR_MEMORY;
References
- Overview of vector indexes
- For information about automatic index rebuilds, see Monitor and maintain vector indexes