The INDEX_VECTOR_MEMORY_ESTIMATE procedure analyzes the memory usage of a vector index in an existing table.
Notice
This procedure uses table statistics to perform its operations. Make sure to run ANALYZE TABLE beforehand to ensure the statistics are up to date.
Syntax
PROCEDURE index_vector_memory_estimate (
IN table_name VARCHAR(65535),
IN column_name VARCHAR(65535),
IN idx_type VARCHAR(65535),
IN idx_parameters LONGTEXT DEFAULT NULL)
Parameters
| Parameter | Description |
|---|---|
| table_name | The name of the table. You can specify the table name or the name of the database and the table name. |
| column_name | The name of the vector column. |
| idx_type | The index type. Valid values: HNSW, HNSW_SQ, HNSW_BQ, IVF_FLAT, IVF_SQ8, and IVF_PQ. The values are case insensitive. |
| idx_parameters | The vector index parameters. This refers to the vector index parameter string used when creating the table, such as distance=l2, type=hnsw, lib=vsag. For more information, see Create a vector index. |
The return value is a string that describes the memory estimation result.
Notice
In OceanBase Database, when you create an HNSW_BQ index, the system automatically creates the index in parallel or in serial based on the memory availability. The maximum memory requirement value for serial index creation is returned by the index_vector_memory_estimate procedure. If the memory can only meet this value, the index creation time may be prolonged because the system cannot create the index in parallel.
Examples
obclient> CALL DBMS_VECTOR.INDEX_VECTOR_MEMORY_ESTIMATE('t1','c1','IVF_FLAT','SAMPLE_PER_NLIST=100');
Query OK, 0 rows affected