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 applies only to OceanBase Database in MySQL mode.
Privilege requirements
Query the parameter
You can use the
SHOW PARAMETERSstatement or theGV$OB_PARAMETERSview to query this parameter in thesystenant and MySQL user tenants.Modify the parameter
You can modify this parameter in the
systenant and MySQL user tenants.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | Int |
| Default value | 0, which indicates the percentage.
NoteBefore V4.4.1, the default value of this parameter indicates that no memory is allocated to vector indexes, which means the vector search feature is disabled.
|
| Value range | [0, 100). The actual 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 MemStore memory ratio. 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.
The table description is as follows:
When you need to create multiple vector indexes in a tenant, the required memory is the sum of all memory.
You need to fill in the first column of the table with the data volume and the second column with the vector dimension values 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 fifth column indicates the minimum memory configuration for newly created indexes in scenarios where no new data is added.
Increase the memory threshold for vector indexes
If you want to increase the memory threshold for vector indexes, we recommend that you first reduce the MemStore memory ratio in the tenant. You can modify the _memstore_limit_percentage parameter in the user tenant.
Notice
Reducing the MemStore ratio may affect the DML performance. Therefore, in environments with high DML pressure, make sure to evaluate the impact before making any changes.
Examples
Set the memory threshold for vector indexes to 30%.
obclient> ALTER SYSTEM SET ob_vector_memory_limit_percentage = 30;
Increase the memory threshold for 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 for vector indexes.
obclient> SHOW PARAMETERS LIKE 'ob_vector_memory_limit_percentage';
