Note
This view is available starting with V4.0.0.
Purpose
The V$OB_TABLET_COMPACTION_HISTORY view displays the history information of tablet-level compactions.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| SVR_IP | varchar(46) | NO | The IP address of the server. |
| SVR_PORT | bigint(20) | NO | The port number of the server. |
| TENANT_ID | bigint(20) | NO | The tenant ID. |
| LS_ID | bigint(20) | NO | The log stream ID. |
| TABLET_ID | bigint(20) | NO | The tablet ID. |
| TYPE | varchar(64) | NO | The type of compaction. Valid values:
|
| COMPACTION_SCN | bigint(20) unsigned | NO | The version information of the compaction. |
| START_TIME | timestamp(6) | NO | The start time. |
| FINISH_TIME | timestamp(6) | NO | The end time. |
| TASK_ID | varchar(64) | NO | The trace of the task. |
| OCCUPY_SIZE | bigint(20) | NO | The data size. |
| MACRO_BLOCK_COUNT | bigint(20) | NO | The number of macroblocks. |
| MULTIPLEXED_MACRO_BLOCK_COUNT | bigint(20) | NO | The number of reused macroblocks. |
| NEW_MICRO_COUNT_IN_NEW_MACRO | bigint(20) | NO | The number of new microblocks in the new macroblock. |
| MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO | bigint(20) | NO | The number of reused microblocks in the new macroblock. |
| TOTAL_ROW_COUNT | bigint(20) | NO | The total number of rows. |
| INCREMENTAL_ROW_COUNT | bigint(20) | NO | The number of new rows. |
| COMPRESSION_RATIO | double | NO | The compression ratio of the new data. The compression ratio is the ratio of the compressed data size to the original data size. |
| NEW_FLUSH_DATA_RATE | bigint(20) | NO | The output speed of the new data, in KB/s. |
| PROGRESSIVE_COMPACTION_ROUND | bigint(20) | NO | The current round of progressive compaction. If the compaction is a full compaction, this column is -1. |
| PROGRESSIVE_COMPACTION_NUM | bigint(20) | NO | The total number of rounds of progressive compaction. |
| PARALLEL_DEGREE | bigint(20) | NO | The parallelism. |
| PARALLEL_INFO | varchar(512) | NO | The information about the parallel task. It displays the statistical information about the data scanned, the running time, and the output data size of the parallel task, including the minimum, maximum, and average values. |
| PARTICIPANT_TABLE | varchar(512) | NO | The information about the table involved in the compaction. |
| MACRO_ID_LIST | varchar(256) | NO | The list of output macroblocks. If the list is too long, it will not be displayed. |
| COMMENTS | varchar(256) | NO | The information about the failed compaction history and the time spent on the current compaction. |
| START_CG_ID | bigint(20) | NO | The start ID of the column group
NoteThis column is available starting with V4.3.0. |
| END_CG_ID | bigint(20) | NO | The end ID of the column group
NoteThis column is available starting with V4.3.0. |
| KEPT_SNAPSHOT | varchar(128) | NO | The information about the multi-version snapshot retained in the current compaction
NoteThis column is available starting with V4.3.0. |
| MERGE_LEVEL | varchar(64) | NO | The information about whether major compaction or microblock reuse is used in the current execution
NoteThis column is available starting with V4.3.0. |
| EXEC_MODE | varchar(64) | NO | The mode of the compaction trace. Valid values:
NoteThis column is available starting with V4.3.3. |
| IS_FULL_MERGE | varchar(5) | NO | Indicates whether the compaction is a full compaction.
NoteThis column is available starting with V4.3.3. |
| IO_COST_TIME_PERCENTAGE | bigint(20) | NO | The percentage of the I/O time in the total compaction time.
NoteThis column is available starting with V4.3.3. |
| MERGE_REASON | varchar(32) | NO | The reason for the major compaction. Valid values:
NoteThis column is available starting with V4.3.3. |
| BASE_MAJOR_STATUS | varchar(64) | NO | The type of the major SSTable before the major compaction:
NoteThis column is available starting with V4.3.3. |
| CO_MERGE_TYPE | varchar(64) | NO | The type of the column store compaction:
NoteThis column is available starting with V4.3.3. |
| MDS_FILTER_INFO | varchar(1024) | NO | The MDS filter information used for the major compaction
Note
|
| EXECUTE_TIME | bigint(20) | NO | The CPU time consumed by the major compaction, in microseconds |
| FILTER_ROW_COUNT | bigint(20) | NO | The number of rows recovered by the major compaction
NoteThis column is available starting with V4.6.0. |
Sample query
Query the tablet-level compaction history information on the current OBServer node in the sys tenant.
obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.V$OB_TABLET_COMPACTION_HISTORY LIMIT 1\G
The query result is as follows:
*************************** 1. row ***************************
SVR_IP: 172.xx.xxx.xxx
SVR_PORT: 2882
TENANT_ID: 1
LS_ID: 1
TABLET_ID: 60476
TYPE: MAJOR_MERGE
COMPACTION_SCN: 1770746400511093000
START_TIME: 2026-02-11 02:04:01.475874
FINISH_TIME: 2026-02-11 02:04:01.483351
TASK_ID: YB42AC1E87C4-00064A6F19927E31-0-0
OCCUPY_SIZE: 0
MACRO_BLOCK_COUNT: 0
MULTIPLEXED_MACRO_BLOCK_COUNT: 0
NEW_MICRO_COUNT_IN_NEW_MACRO: 0
MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO: 0
TOTAL_ROW_COUNT: 0
INCREMENTAL_ROW_COUNT: 0
COMPRESSION_RATIO: 1
NEW_FLUSH_DATA_RATE: 0
PROGRESSIVE_COMPACTION_ROUND: 1
PROGRESSIVE_COMPACTION_NUM: 0
PARALLEL_DEGREE: 1
PARALLEL_INFO: -
PARTICIPANT_TABLE: table_cnt=1,[MAJOR]snapshot_version=1;
MACRO_ID_LIST:
COMMENTS:
START_CG_ID: 0
END_CG_ID: 0
KEPT_SNAPSHOT: {type:"LS_RESERVED", snapshot:1770744820611396000}
MERGE_LEVEL: MICRO_BLOCK_LEVEL
EXEC_MODE: EXEC_MODE_LOCAL
IS_FULL_MERGE: FALSE
IO_COST_TIME_PERCENTAGE: 0
MERGE_REASON: TENANT_MAJOR
BASE_MAJOR_STATUS:
CO_MERGE_TYPE:
MDS_FILTER_INFO:
EXECUTE_TIME: 792
FILTER_ROW_COUNT: 0
1 row in set
References
Query the tablet-level compaction history information on all nodes: GV$OB_TABLET_COMPACTION_HISTORY
Query the tablet-level compaction progress information on the current node: V$OB_TABLET_COMPACTION_PROGRESS
