Note
For V4.3.3, this parameter is available starting with V4.3.3.
Description
ob_vector_memory_limit_percentage specifies the threshold for the memory resources occupied by the vector index module.
Applicability
This parameter is applicable only to OceanBase Database in MySQL-compatible mode.
Privilege requirements
Query the parameter
systenant and MySQL user tenants can query this parameter by using theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview.Modify the parameter
systenant and MySQL user tenants can modify this parameter.
Attributes
| Attribute | Description |
|---|---|
| Type | Int |
| Default value | 0. The unit is percentage.
NoteBefore V4.4.1, the default value of this parameter indicates that no memory is allocated to vector indexes, which means that vector search is disabled.
|
| Value range | [0, 100). The maximum value is 85 - Memstore (i.e., the value of the memstore_limit_percentage parameter). When the memstore_limit_percentage parameter is set to 0 (the default value), the system automatically calculates the memory ratio occupied by MemStore. The calculation rules are as follows:
|
| Modifiable | Yes. You can use the ALTER SYSTEM SET statement to modify the parameter. |
| Effective upon OBServer node restart | No. The setting takes effect immediately. |
Considerations
Memory calculation
You need to plan the value of this parameter based on the calculation formula and business requirements. Click Download memory calculation table to calculate the parameter value.
Table description:
When you need to create multiple vector indexes in a tenant, the required memory is the total memory of all indexes.
You need to fill in the first column of the table with the data volume and the second column with the vector dimension value based on your business scenarios.
The third column M indicates the maximum number of edges in the HNSW graph index. The default value is
16, which usually does not need to be changed.The minimum memory configuration in the fifth column is only for newly created indexes that do not involve any new data.
Increase the memory usage threshold of vector indexes
If you want to increase the memory usage threshold of vector indexes, we recommend that you first reduce the memory ratio occupied by MemStore in the tenant. You can modify the _memstore_limit_percentage parameter in the user tenant.
Notice
Reducing the MemStore memory ratio may affect the DML performance. Therefore, we recommend that you evaluate the impact before making changes in environments with high DML pressure.
Examples
Set the memory usage threshold of vector indexes to 30%.
obclient> ALTER SYSTEM SET ob_vector_memory_limit_percentage = 30;
Increase the memory usage threshold of vector indexes to 59%.
obclient> ALTER SYSTEM SET _memstore_limit_percentage = 25;
ALTER SYSTEM SET ob_vector_memory_limit_percentage = 59;
View the current memory configuration of vector indexes.
obclient> SHOW PARAMETERS LIKE 'ob_vector_memory_limit_percentage';