Note
Introduced in V4.0.0.
Description
The GV$OB_TABLET_COMPACTION_HISTORY view displays the historical information about tablet-level major compactions.
Field descriptions
| Field | Type | Allow NULL | 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 | Data shard ID |
| TYPE | varchar(64) | NO | The type of compaction. The possible values are:
|
| COMPACTION_SCN | bigint(20) unsigned | NO | The version information of the compaction. |
| START_TIME | timestamp(6) | NO | Start time |
| FINISH_TIME | timestamp(6) | NO | End time |
| TASK_ID | varchar(64) | NO | The execution trace of the task. |
| OCCUPY_SIZE | bigint(20) | NO | The amount of data. |
| 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 a new macroblock. |
| MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO | bigint(20) | NO | The number of reused microblocks in a new macroblock. |
| TOTAL_ROW_COUNT | bigint(20) | NO | The total number of rows. |
| INCREMENTAL_ROW_COUNT | bigint(20) | NO | The number of new rows output. |
| COMPRESSION_RATIO | double | NO | The compression ratio of new data = (size of compressed new macroblock data/size of uncompressed new macroblock data). |
| NEW_FLUSH_DATA_RATE | bigint(20) | NO | The output speed of new data, in KB/s. |
| PROGRESSIVE_COMPACTION_ROUND | bigint(20) | NO | The current round of progressive compaction (if this is a full major compaction, the value of this column is -1). |
| PROGRESSIVE_COMPACTION_NUM | bigint(20) | NO | The total number of rounds of progressive compaction. |
| PARALLEL_DEGREE | bigint(20) | NO | The degree of parallelism. |
| PARALLEL_INFO | varchar(512) | NO | The information about parallel tasks, which displays the statistics (minimum value, maximum value, and average value) of the data scanned, runtime, and data output for each parallel task. |
| PARTICIPANT_TABLE | varchar(512) | NO | The tables that participate in the compaction. |
| MACRO_ID_LIST | varchar(256) | NO | The list of macroblocks output. If the list is too long, it is not displayed. |
| COMMENTS | varchar(256) | NO | Records the history of failed compactions and the collection information of the duration 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 information about the multi-version snapshot retained by the compaction
NoteThis field is introduced in V4.3.0. |
| MERGE_LEVEL | varchar(64) | NO | Specifies whether the compaction or macroblock reuse is enabled during the compaction
NoteThis field is introduced in V4.3.0. |
Examples
The sys tenant queries the historical information about tablet-level major 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.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
1 row in set