Note
This view is available starting with V4.0.0.
Purpose
The V$OB_TABLET_COMPACTION_HISTORY view displays the history of tablet-level compactions.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| SVR_IP | varchar(46) | NO | Server IP address |
| SVR_PORT | bigint(20) | NO | Server port number |
| TENANT_ID | bigint(20) | NO | Tenant ID |
| LS_ID | bigint(20) | NO | Log stream ID |
| TABLET_ID | bigint(20) | NO | Tablet ID |
| TYPE | varchar(64) | NO | Compaction type:
|
| COMPACTION_SCN | bigint(20) unsigned | NO | Compaction version information |
| START_TIME | timestamp(6) | NO | Start time |
| FINISH_TIME | timestamp(6) | NO | End time |
| TASK_ID | varchar(64) | NO | Task execution trace |
| OCCUPY_SIZE | bigint(20) | NO | Data size |
| MACRO_BLOCK_COUNT | bigint(20) | NO | Number of macro blocks |
| MULTIPLEXED_MACRO_BLOCK_COUNT | bigint(20) | NO | Number of reused macro blocks |
| NEW_MICRO_COUNT_IN_NEW_MACRO | bigint(20) | NO | Number of new microblocks in new macro blocks |
| MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO | bigint(20) | NO | Number of reused microblocks in new macro blocks |
| TOTAL_ROW_COUNT | bigint(20) | NO | Total number of rows |
| INCREMENTAL_ROW_COUNT | bigint(20) | NO | Number of new rows |
| COMPRESSION_RATIO | double | NO | New data compression ratio = ratio of compressed data size to original data size in new macro blocks |
| NEW_FLUSH_DATA_RATE | bigint(20) | NO | New data output speed, in KB/s |
| PROGRESSIVE_COMPACTION_ROUND | bigint(20) | NO | Progressive compaction round (if it is a full compaction, this column is -1) |
| PROGRESSIVE_COMPACTION_NUM | bigint(20) | NO | Total number of progressive compaction rounds |
| PARALLEL_DEGREE | bigint(20) | NO | Parallelism |
| PARALLEL_INFO | varchar(512) | NO | Parallel task information. It displays the statistics of the amount of data scanned, the running time, and the amount of data output by the parallel task (minimum, maximum, and average). |
| PARTICIPANT_TABLE | varchar(512) | NO | Table information involved in the compaction |
| MACRO_ID_LIST | varchar(256) | NO | List of output macro blocks. If the list is too long, it is not displayed. |
| COMMENTS | varchar(256) | NO | Records the compaction history information of failed compactions and the time taken for the current compaction. |
| START_CG_ID | bigint(20) | NO | Column Group Start ID
NoteThis column is available starting with V4.3.0. |
| END_CG_ID | bigint(20) | NO | Column Group End ID
NoteThis column is available starting with V4.3.0. |
| KEPT_SNAPSHOT | varchar(128) | NO | Compaction multi-version point retention information
NoteThis column is available starting with V4.3.0. |
| MERGE_LEVEL | varchar(64) | NO | Compaction/microblock reuse information
NoteThis column is available starting with V4.3.0. |
| EXEC_MODE | varchar(64) | NO | Compaction trace mode:
NoteThis column is available starting with V4.3.3. |
| IS_FULL_MERGE | varchar(5) | NO | Indicates whether it is a full compaction.
NoteThis column is available starting with V4.3.3. |
| IO_COST_TIME_PERCENTAGE | bigint(20) | NO | The ratio of I/O time to 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. Valid values:
NoteThis column is available starting with V4.3.3. |
| CO_MERGE_TYPE | varchar(64) | NO | The type of the columnar major compaction. Valid values:
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 to be recovered by the major compaction.
NoteThis column is available starting with V4.6.0. |
Sample query
Query the tablet-level compaction history on the current OBServer node of the user tenant.
obclient(root@mysql001)[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: 1002
LS_ID: 1
TABLET_ID: 60379
TYPE: MAJOR_MERGE
COMPACTION_SCN: 1770746402543355000
START_TIME: 2026-02-11 02:03:26.743059
FINISH_TIME: 2026-02-11 02:03:26.751584
TASK_ID: YB42AC1E87C4-00064A6F20227C22-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:1770744792640865000}
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: 827
FILTER_ROW_COUNT: 0
1 row in set
References
Query the detailed history of tablet-level major compactions on all nodes: GV$OB_TABLET_COMPACTION_HISTORY
Query the progress of tablet-level major compactions on the current node: V$OB_TABLET_COMPACTION_PROGRESS
