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 |
| 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 | Tablet ID |
| TYPE | varchar(64) | NO | Compaction type. Valid values:
|
| 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 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 new macroblocks |
| MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO | bigint(20) | NO | Number of reused microblocks in new macroblocks |
| TOTAL_ROW_COUNT | bigint(20) | NO | Total number of rows |
| INCREMENTAL_ROW_COUNT | bigint(20) | NO | Number of new rows |
| COMPRESSION_RATIO | double | NO | Compression ratio of new data = (Compressed size of new macroblock data) / (Uncompressed size of new macroblock data) |
| NEW_FLUSH_DATA_RATE | bigint(20) | NO | Output speed of new data, in KB/s |
| PROGRESSIVE_COMPACTION_ROUND | bigint(20) | NO | Progressive compaction round (if it is a full compaction, the value 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 scanned data volume, running time, and output data volume of the parallel task (minimum value, maximum value, and average value). |
| PARTICIPANT_TABLE | varchar(512) | NO | Table information involved in the current compaction |
| MACRO_ID_LIST | varchar(256) | NO | List of output macroblocks. If the list is too long, it will not be displayed. |
| COMMENTS | varchar(256) | NO | Records the history of failed compactions and the time spent on the current compaction. |
| START_CG_ID | bigint(20) | NO | Start ID of the column group
NoteThis column is available starting with V4.3.0. |
| END_CG_ID | bigint(20) | NO | 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 point in time retained in the current compaction
NoteThis column is available starting with V4.3.0. |
| MERGE_LEVEL | varchar(64) | NO | Indicates 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 execution mode of the current compaction. Valid values:
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 percentage of 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 initiating a 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 column store 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 task, in milliseconds. |
Sample query
Query the history of tablet-level major compactions on the current OBServer node as the sys tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.V$OB_TABLET_COMPACTION_HISTORY LIMIT 1\G
The query result is as follows:
*************************** 1. row ***************************
SVR_IP: 172.xx.xx.xx
SVR_PORT: 2882
TENANT_ID: 1
LS_ID: 1
TABLET_ID: 60476
TYPE: MAJOR_MERGE
COMPACTION_SCN: 1722880802113420567
START_TIME: 2024-08-06 02:00:06.614158
FINISH_TIME: 2024-08-06 02:00:06.620664
TASK_ID: YB4XXXXXXXXX-000XXXXXXXXXXXXX-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: comment="merge_reason="TENANT_MAJOR";time=add_time:1722880806613978|total=6.51ms;";
START_CG_ID: 0
END_CG_ID: 0
KEPT_SNAPSHOT: {type:"SNAPSHOT_UNDO_RETENTION", snapshot:1722879002117556503}
MERGE_LEVEL: MICRO_BLOCK_LEVEL
EXEC_MODE: EXEC_MODE_LOCAL
IO_COST_TIME_PERCENTAGE: 5
MERGE_REASON:
BASE_MAJOR_STATUS:
CO_MERGE_TYPE:
MDS_FILTER_INFO:
EXECUTE_TIME: 747
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