Note
This view is introduced in V4.0.0.
Purpose
The GV$OB_TABLET_COMPACTION_HISTORY view displays the historical information about tablet-level compactions.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| SVR_IP | varchar(46) | NO | Server IP address. |
| SVR_PORT | bigint(20) | NO | Server port. |
| TENANT_ID | bigint(20) | NO | Tenant ID. |
| LS_ID | bigint(20) | NO | Log stream ID. |
| TABLET_ID | bigint(20) | NO | Data tablet ID. |
| TYPE | varchar(64) | NO | Type of compaction. Valid values:
|
| COMPACTION_SCN | bigint(20) unsigned | NO | Compaction version. |
| 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 reused macroblocks. |
| NEW_MICRO_COUNT_IN_NEW_MACRO | bigint(20) | NO | Number of new microblocks in the new macroblock. |
| MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO | bigint(20) | NO | Number of reused microblocks in the new macroblock. |
| TOTAL_ROW_COUNT | bigint(20) | NO | Total number of rows. |
| INCREMENTAL_ROW_COUNT | bigint(20) | NO | Number of new rows output. |
| COMPRESSION_RATIO | double | NO | Compression ratio of new data = compressed size of new macroblocks / original size of new macroblocks. |
| NEW_FLUSH_DATA_RATE | bigint(20) | NO | Output speed of new data, in Kbit/s. |
| PROGRESSIVE_COMPACTION_ROUND | bigint(20) | NO | Current round of progressive compaction. The value is -1 for full compaction. |
| PROGRESSIVE_COMPACTION_NUM | bigint(20) | NO | Total number of rounds of progressive compaction. |
| PARALLEL_DEGREE | bigint(20) | NO | Degree of parallelism. |
| PARALLEL_INFO | varchar(512) | NO | Parallel task information. It displays the statistics of the minimum, maximum, and average values of the data scanned, running time, and data output in the parallel task. |
| PARTICIPANT_TABLE | varchar(512) | NO | Table information about the participating tables in this compaction. |
| MACRO_ID_LIST | varchar(256) | NO | Output macroblock list. If the list is too long, it is not displayed. |
| COMMENTS | varchar(256) | NO | Records the history of failed compactions and the time consumption of this compaction. |
| START_CG_ID | bigint(20) | NO | Column Group ID of the start ID
NoteThis field is introduced in V4.3.0. |
| END_CG_ID | bigint(20) | NO | Column Group ID of the end ID
NoteThis field is introduced in V4.3.0. |
| KEPT_SNAPSHOT | varchar(128) | NO | The multi-version timestamp retained in this compaction
NoteThis field is introduced in V4.3.0. |
| MERGE_LEVEL | varchar(64) | NO | Whether to perform major compaction or reuse microblocks
NoteThis field is introduced in V4.3.0. |
| EXEC_MODE | varchar(64) | NO | The mode of this major compaction. Valid values:
NoteThis field is introduced in V4.3.3. |
| IS_FULL_MERGE | varchar(5) | NO | Whether it is a full compaction.
NoteThis field is introduced in V4.3.3. |
| IO_COST_TIME_PERCENTAGE | bigint(20) | NO | The percentage of I/O time in the compaction time.
NoteThis field is introduced in V4.3.3. |
| MERGE_REASON | varchar(32) | NO | The reason for initiating the compaction. Valid values:
NoteThis field is introduced in V4.3.3. |
| BASE_MAJOR_STATUS | varchar(64) | NO | The type of major SSTable before the compaction. Valid values:
NoteThis field is introduced in V4.3.3. |
| CO_MERGE_TYPE | varchar(64) | NO | The type of columnar compaction. Valid values:
NoteThis field is introduced in V4.3.3. |
| MDS_FILTER_INFO | varchar(1024) | NO | Displays the MDS filter information used for major compaction.
NoteThis field was introduced in V4.3.5 and takes effect starting from V4.3.5 BP2. |
| EXECUTE_TIME | bigint(20) | NO | The time consumed by the major compaction task for CPU, in milliseconds.
NoteThis field was introduced in V4.3.5 BP3. |
Sample query
The following example shows how to query the system tenant for the historical information about tablet-level compactions on all OBServer nodes.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$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: 1750701602210927000
START_TIME: 2025-06-24 02:03:01.600203
FINISH_TIME: 2025-06-24 02:03:01.610279
TASK_ID: YB42AC1E87D9-00063837D487BD50-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:"UNDO_RETENTION", snapshot:1750699972353254000}
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: 691
1 row in set