Note
This parameter was introduced in OceanBase Database V4.3.3.
Description
The ob_vector_memory_limit_percentage parameter specifies the memory usage threshold (in percentage) for the vector index module.
Privilege requirements
Query the parameter
The
systenant and MySQL tenants can execute theSHOW PARAMETERSstatement or query theGV$OB_PARAMETERSview to view the parameter.Modify the parameter
The
systenant and MySQL user tenants can modify the parameter.
Attributes
| Attribute | Description |
|---|---|
| Type | Int |
| Default value | 0
NoticeFor versions earlier than V4.3.5 BP3, the default value indicates that no memory is allocated for vector indexes, which disables the vector search feature.
|
| Valid values | [0, 100). The actual maximum value is 85 - MemStore (that is, memstore_limit_percentage). When the memstore_limit_percentage parameter is set to 0 (the default value), the system automatically calculates the memory usage ratio of MemStore. The automatic calculation rules are as follows:
|
| Modifiable | Yes. You can execute the ALTER SYSTEM SET statement to modify the parameter. |
| Effective after restart of OBServer node | No. The parameter takes effect immediately after it is set. |
Considerations
Memory calculation
The value of this parameter needs to be planned based on the formula and business requirements. For more information, click Download the memory calculation table to calculate the parameter value.
Description of the table:
If multiple vector indexes need to be created under a single tenant, the required memory is the total of all indexes.
You need to fill in the first column (data volume) and the second column (vector dimension) of the sheet according to your business scenario.
The third column, M, in the table represents the maximum number of edges for the HNSW graph index. The default value is 16, and it typically does not need to be modified.
The fifth column, minimum memory configuration, is only applicable for scenarios where the index is created after the fact and no new data is added.
Increase the memory usage for vector indexes
If you need to increase the memory usage threshold for vector indexes, it is recommended to first reduce the MemStore memory ratio for the tenant. This can be achieved by modifying the _memstore_limit_percentage parameter in the user tenant.
Notice
Reducing the MemStore ratio may impact DML performance. Therefore, in environments with high DML pressure, make sure to evaluate the impact before making any changes.
Example
Set the threshold for memory usage by vector indexes to 30%.
obclient> ALTER SYSTEM SET ob_vector_memory_limit_percentage = 30;
Increase the the memory usage threshold for vector indexes to 59%.
obclient> ALTER SYSTEM SET _memstore_limit_percentage = 25;
ALTER SYSTEM SET ob_vector_memory_limit_percentage = 59;
Check the current memory configuration for vector indexes.
obclient> SHOW PARAMETERS LIKE 'ob_vector_memory_limit_percentage';