Note
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
The
systenant and MySQL user tenants can query this parameter by using theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview.Modify the parameter
The
systenant and MySQL user tenants can modify this parameter.
Attributes
| Attribute | Description |
|---|---|
| Type | Int |
| Default value | 0, in percentage.
NoteBefore V4.3.5 BP3, this parameter's default value indicates that no memory is allocated to vector indexes, effectively disabling vector search.
|
| Value range | [0, 100). The actual maximum value is 85 - Memstore (i.e., the value of the memstore_limit_percentage parameter). When memstore_limit_percentage is set to 0 (the default), the system automatically calculates the MemStore memory ratio. The automatic 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
The specific value of this parameter needs to be planned based on the calculation formula and business requirements. Please 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 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 value based on your business scenario.
The third column M represents the maximum number of edges in the HNSW graph index. The default value is
16, which typically does not need to be changed.The fifth column's minimum memory configuration is only for newly created indexes and scenarios without any new data.
Increase the vector index memory threshold
If you want to increase the threshold for vector index memory usage, it is recommended to first reduce the MemStore memory ratio in the tenant. You can achieve this by modifying the _memstore_limit_percentage parameter in the user tenant.
Notice
Reducing the MemStore ratio may affect DML performance. Therefore, in environments with high DML pressure, please evaluate before making any changes.
Examples
Set the vector index memory threshold to 30%.
obclient> ALTER SYSTEM SET ob_vector_memory_limit_percentage = 30;
Increase the vector index memory threshold to 59%.
obclient> ALTER SYSTEM SET _memstore_limit_percentage = 25;
ALTER SYSTEM SET ob_vector_memory_limit_percentage = 59;
View the current vector index memory configuration.
obclient> SHOW PARAMETERS LIKE 'ob_vector_memory_limit_percentage';