Overview
The V$OB_TABLET_COMPACTION_HISTORY view displays historical information on tablet-level compaction.
Columns
Field Name |
Type |
Nullable |
Description |
|---|---|---|---|
| SVR_IP | varchar(46) | NO | Server IP |
| 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 | Data Shard ID |
| TYPE | varchar(64) | NO | Compaction type:
|
| COMPACTION_SCN | bigint(20) unsigned | NO | Major 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 volume |
| MACRO_BLOCK_COUNT | bigint(20) | NO | Number of Macroblocks |
| MULTIPLEXED_MACRO_BLOCK_COUNT | bigint(20) | NO | Number of Macroblocks Reused |
| NEW_MICRO_COUNT_IN_NEW_MACRO | bigint(20) | NO | Number of New Microblocks in the Newly Generated Macroblock |
| MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO | bigint(20) | NO | Number of Reusable Microblocks in the Newly Generated Macroblock |
| TOTAL_ROW_COUNT | bigint(20) | NO | Total Rows |
| INCREMENTAL_ROW_COUNT | bigint(20) | NO | New Output Row |
| COMPRESSION_RATIO | double | NO | Compression ratio of new data = Ratio of compressed data to uncompressed data of newly added macroblocks |
| NEW_FLUSH_DATA_RATE | bigint(20) | NO | Output speed of new data, in KB/s |
| PROGRESSIVE_COMPACTION_ROUND | bigint(20) | NO | Asymptotic Major Compaction Current Round (This column is -1 for a full compaction.) |
| PROGRESSIVE_COMPACTION_NUM | bigint(20) | NO | Total Number of Asymptotic Major Compactions |
| PARALLEL_DEGREE | bigint(20) | NO | Degree of Parallelism |
| PARALLEL_INFO | varchar(512) | NO | Parallel task information, displaying statistics on the data scanned, running time, and output data volume (minimum/maximum/average) of the parallel task. |
| PARTICIPANT_TABLE | varchar(512) | NO | Information about tables participating in this compaction |
| MACRO_ID_LIST | varchar(256) | NO | The output macroblock list. If the macroblock list is too long, it will not be displayed. |
| COMMENTS | varchar(256) | NO | Records the history of failed compactions and collects information on the duration of the current compaction. |
| START_CG_ID | bigint(20) | NO | Start ID of Column Group |
| END_CG_ID | bigint(20) | NO | End ID of Column Group |
| KEPT_SNAPSHOT | varchar(128) | NO | Displays the multi-version timestamp retained for this compaction. |
| MERGE_LEVEL | varchar(64) | NO | Displays whether major compaction or microblock reuse was used during this execution. |
| EXEC_MODE | varchar(64) | NO | The mode that displays the major compaction trace:
|
| IS_FULL_MERGE | varchar(5) | NO | Whether it is a full compaction. |
| IO_COST_TIME_PERCENTAGE | bigint(20) | NO | The ratio of I/O time to major compaction time. |
| MERGE_REASON | varchar(32) | NO | Reasons for concurrent initiation. Valid values:
|
| BASE_MAJOR_STATUS | varchar(64) | NO | Type of the major SSTable before major compaction:
|
| CO_MERGE_TYPE | varchar(64) | NO | Columnar storage major compaction type:
|
| MDS_FILTER_INFO | varchar(1024) | NO | Displays the MDS filter information used for major compaction. |
| EXECUTE_TIME | bigint(20) | NO | CPU Time Consumed by Major Compaction Tasks, in Microseconds |
| FILTER_ROW_COUNT | bigint(20) | NO | Number of rows reclaimed through compaction |
Sample query
The system tenant queries the historical information about tablet-level compactions on the current OBServer node.
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
View detailed historical information on tablet-level compactions across all nodes: GV$OB_TABLET_COMPACTION_HISTORY
View the progress information of tablet-level compaction on the current node: V$OB_TABLET_COMPACTION_PROGRESS