Overview
The CDB_OB_VECTOR_INDEX_TASK_HISTORY view displays the historical information of all vector index-related background tasks for all tenants in a cluster, including partition rebuilding, segment minor compaction and major compaction, IVF cluster center loading and cleanup, semantic index refreshing, and memory synchronization. You can distinguish task types by using the TASK_TYPE column in the view.
Columns
Field |
Column type |
Nullable |
Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | YES | Tenant ID |
| TABLE_ID | bigint(20) | YES | Table ID |
| TABLET_ID | bigint(20) | YES | Partition ID |
| TASK_ID | bigint(20) | YES | Task ID |
| CREATE_TIME | timestamp(6) | YES | Task creation time
NoteThis field is supported starting from V4.6.2.1. |
| MODIFY_TIME | timestamp(6) | YES | The time when the task was last updated. This field is automatically refreshed each time the row record in the table is updated.NoteThe meaning of this field has changed from the task end time to the task update time since V4.6.2.1. |
| TRIGGER_TYPE | varchar(16) | NO | Task trigger type:
NoteStarting from V4.6.2.1, this field is displayed as a string enumeration instead of a numeric value. |
| STATUS | varchar(16) | NO | Task status:
NoteStarting from V4.6.2.1, this field has been changed from a numeric value to a string enumeration, and the |
| TASK_TYPE | varchar(64) | NO | Task type:
NoteStarting from V4.6.2.1, this field has been changed from a numeric value to a string enumeration, and task types |
| TASK_SCN | bigint(20) | NO | Task Version |
| RET_CODE | bigint(20) | NO | Status at the end of the task:
|
| TRACE_ID | varchar(512) | NO | Task Execution Tracking ID |
| TASK_INFO | longtext | NO | Detailed progress information of the task. The information is displayed in JSON format and includes details of each segment in a major compaction task, such as the SCN, key range, index, and memory usage. For tasks that consume significant memory, such as partition-level index rebuilding or incremental segment merging, the output may also include mem_limit_info The memory throttling section records information related to memory throttling (supported starting from V4.6.2.1), facilitating a comprehensive understanding of the task execution process. |
| EXEC_ADDR | varchar(52) | YES | The node that executes the task (in the format of IP address:port), which identifies the server address where the task is actually running. The default value is empty.
NoteThis field is supported starting from V4.6.2.1. |
| PRIORITY | int | NO | Task priority. A smaller value indicates a higher priority, decreasing in order. The default value is 0.
NoteThis field is supported starting with V4.6.2.1. |
| START_TIME | timestamp(6) | YES | The time when the task starts to be executed. This parameter is empty by default. |
| END_TIME | timestamp(6) | YES | End time of task execution. This field is empty by default.
NoteThis field is supported starting from V4.6.2.1. |
| ERR_MSG | varchar(1024) | YES | Error message when the task fails. The default value is empty.
NoteThis field is supported starting from V4.6.2.1. |
Sample query
Complete example
In the sys tenant, view the historical information of vector index performance optimization tasks for all tenants.
SELECT * FROM oceanbase.CDB_OB_VECTOR_INDEX_TASK_HISTORY ORDER BY MODIFY_TIME DESC\G;
The query result is as follows:
*************************** 1. row ***************************
TENANT_ID: 1004
TABLE_ID: 500180
TABLET_ID: 1152921504606847128
TASK_ID: 10091
CREATE_TIME: 2026-03-25 23:20:31.475323
MODIFY_TIME: 2026-03-25 23:20:32.484323
TRIGGER_TYPE: AUTO
STATUS: FINISHED
TASK_TYPE: INCREMENTAL_INDEX_MERGE
TASK_SCN: 1774452031481903000
RET_CODE: 0
TRACE_ID: Y2C277F000001-00064DDA40B0F2AE-0-1
TASK_INFO: {"merge_segments_cnt":2,"merge_segments":[{"scn":1774451941331810002,"start_key":"1152921504606847129_1774451941331810002_hnsw_data_part00000","end_key":"1152921504606847129_1774451941331810002_hnsw_data_part00000","index_type":"HNSW","vector_cnt":"1005","mem_used":"252512","mem_hold":"252512","min_vid":"11","max_vid":"10005"},{"scn":1774452021463248000,"start_key":"1152921504606847129_1774452021463248000_hgraph_data_part00000","end_key":"1152921504606847129_1774452021463248000_hgraph_data_part00002","index_type":"HGRAPH","vector_cnt":"1000","mem_used":"8484032","mem_hold":"8484032","min_vid":"1011","max_vid":"2010"}],"result_segments":[{"scn":1774452031481903000,"start_key":"1152921504606847129_1774452031481903000_hnsw_data_part00000","end_key":"1152921504606847129_1774452031481903000_hnsw_data_part00000","index_type":"HNSW","vector_cnt":"2005","mem_used":"803354","mem_hold":"0","min_vid":"11","max_vid":"10005"}]}
EXEC_ADDR: 11.xxx.xx.xx:30510
PRIORITY: 0
START_TIME: 2026-03-25 23:20:31.476100
END_TIME: 2026-03-25 23:20:32.484323
ERR_MSG: NULL
1 row in set
The following table describes the fields of the TASK_INFO string.
Field |
JSON field types |
Meaning |
|---|---|---|
| merge_segments_cnt | string | Number of Segments to Be Merged |
| merge_segments | array | Segment information before major compaction. The number of segments is equal to merge_segments_cnt. |
| result_segments | array | Information on the Merged Segment |
| scn | string | Internal Timestamp |
| start_key | string | Upper Bound of Segment Storage Range |
| end_key | string | Lower bound of segment storage range |
| index_type | string | The index type for processing vectors. Valid values:
|
| mem_used | string | Memory Used by Segments |
| mem_limit_info | object | Memory Throttling Information, Including task_memory_limited, vector_mem_hold, vector_mem_limit, task_estimate_memory, tasks_total_reserved_memory and other fields. This only occurs in memory-intensive tasks such as partition-level index rebuilding or incremental segment merging. |
| min_vid | string | Minimum Vector ID of a Segment |
| max_vid | string | Maximum Vector ID of a Segment |
View memory throttling information
Note
This feature is supported starting from V4.6.2.1.
For memory-intensive tasks such as partition-level index rebuilding and incremental segment merging, the TASK_INFO field contains a mem_limit_info segment after the task is completed, which records information related to memory throttling. You can query the following SQL statement to obtain the estimated memory usage and throttling information:
SELECT
TABLET_ID,
TASK_TYPE,
JSON_EXTRACT(TASK_INFO, '$.mem_limit_info.task_estimate_memory') AS estimate_mem,
JSON_EXTRACT(TASK_INFO, '$.mem_limit_info.vector_mem_hold') AS mem_hold,
JSON_EXTRACT(TASK_INFO, '$.mem_limit_info.vector_mem_limit') AS mem_limit,
JSON_EXTRACT(TASK_INFO, '$.mem_limit_info.task_memory_limited') AS was_throttled
FROM OCEANBASE.CDB_OB_VECTOR_INDEX_TASK_HISTORY
WHERE TASK_TYPE = 'PARTITION_REBUILD';
The subfields of the mem_limit_info field are described in detail as follows:
Subfield |
Unit |
Note |
|---|---|---|
task_memory_limited |
Whether memory throttling has been triggered (true/false) | |
vector_mem_hold |
byte | Tenant Vector Memory Usage During Task Scheduling |
vector_mem_limit |
byte | Total Tenant Vector Memory Limit |
task_estimate_memory |
byte | Estimated Memory Requirement for the Current Task |
tasks_total_reserved_memory |
byte | Total Reserved Memory for Other Running Tasks |
References
- DBA_OB_VECTOR_INDEX_TASK_HISTORY
- For the relationship between HNSW vector index minor compactions, major compactions, and task types, see Indexes
- For more information about maintenance and manual triggering, see Monitor and maintain indexes