Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
The GV$OB_TABLET_COMPACTION_HISTORY view displays information about historical tablet-level compactions.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| SVR_IP | varchar(46) | NO | The IP address of the OBServer node. |
| SVR_PORT | bigint(20) | NO | The port number of the OBServer node. |
| TENANT_ID | bigint(20) | NO | The ID of the tenant. |
| LS_ID | bigint(20) | NO | The ID of the log stream. |
| TABLET_ID | bigint(20) | NO | The ID of the tablet. |
| TYPE | varchar(64) | NO | The compaction type. Valid values: MINI: minor or L0 compaction that converts MemTables into SSTables.MAJOR: major compaction.MINI MINOR: L1 compaction that combines multiple mini SSTables into one.BUF MINOR: buffer minor compaction that generates special buffer minor SSTables. |
| COMPACTION_SCN | bigint(20) unsigned | NO | The major compaction version. |
| START_TIME | timestamp(6) | NO | The start time. |
| FINISH_TIME | timestamp(6) | NO | The end time. |
| TASK_ID | varchar(64) | NO | The task execution trace. |
| OCCUPY_SIZE | bigint(20) | NO | The data amount. |
| 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 newly generated macroblock. |
| MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO | bigint(20) | NO | The number of reused microblocks in a newly generated macroblock. |
| TOTAL_ROW_COUNT | bigint(20) | NO | The total number of rows. |
| INCREMENTAL_ROW_COUNT | bigint(20) | NO | The number of new rows. |
| COMPRESSION_RATIO | double | NO | The compression ratio of new data, which is the ratio of the size of compressed new macroblock data to the data size before compression. |
| NEW_FLUSH_DATA_RATE | bigint(20) | NO | The output speed of new data, in KB/s. |
| PROGRESSIVE_COMPACTION_ROUND | bigint(20) | NO | The current compaction round during a progressive compaction. For a full compaction, the value is -1. |
| PROGRESSIVE_COMPACTION_NUM | bigint(20) | NO | The total number of compaction rounds in a progressive compaction. |
| PARALLEL_DEGREE | bigint(20) | NO | The degree of parallelism. |
| PARALLEL_INFO | varchar(512) | NO | The parallel task information, including statistics (MIN/MAX/AVG) on the scanned data amount, operating time, and output data amount of the parallel task. |
| PARTICIPANT_TABLE | varchar(512) | NO | The table that participates in the compaction. |
| MACRO_ID_LIST | varchar(256) | NO | The list of output macroblocks. If the macroblock list is too long, it is not displayed. |
| COMMENTS | varchar(1024) | NO | The comments that describe the problems encountered during scheduling or execution. |
| START_CG_ID | bigint(20) | NO | The ID of the first column in the column group.
NoteThis column is introduced since OceanBase Database V4.3.0. |
| END_CG_ID | bigint(20) | NO | The ID of the last column in the column group.
NoteThis column is introduced since OceanBase Database V4.3.0. |
| KEPT_SNAPSHOT | varchar(128) | NO | The multi-version snapshot for the compaction.
NoteThis column is introduced since OceanBase Database V4.3.0. |
| MERGE_LEVEL | varchar(64) | NO | Indicates whether a major compaction was performed or microblocks were reused.
NoteThis column is introduced since OceanBase Database V4.3.0. |
Sample query
obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_TABLET_COMPACTION_HISTORY LIMIT 1;
The query result is as follows:
+----------------+----------+-----------+-------+-----------+-------------+---------------------+----------------------------+----------------------------+-----------------------------------+-------------+-------------------+-------------------------------+------------------------------+--------------------------------------+-----------------+-----------------------+-------------------+---------------------+------------------------------+----------------------------+-----------------+---------------+----------------------------------------+---------------+-------------------------------------------------------------------------------------+-------------+-----------+-----------------------------------------------------------------+-------------------+
| SVR_IP | SVR_PORT | TENANT_ID | LS_ID | TABLET_ID | TYPE | COMPACTION_SCN | START_TIME | FINISH_TIME | TASK_ID | OCCUPY_SIZE | MACRO_BLOCK_COUNT | MULTIPLEXED_MACRO_BLOCK_COUNT | NEW_MICRO_COUNT_IN_NEW_MACRO | MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO | TOTAL_ROW_COUNT | INCREMENTAL_ROW_COUNT | COMPRESSION_RATIO | NEW_FLUSH_DATA_RATE | PROGRESSIVE_COMPACTION_ROUND | PROGRESSIVE_COMPACTION_NUM | PARALLEL_DEGREE | PARALLEL_INFO | PARTICIPANT_TABLE | MACRO_ID_LIST | COMMENTS | START_CG_ID | END_CG_ID | KEPT_SNAPSHOT | MERGE_LEVEL |
+----------------+----------+-----------+-------+-----------+-------------+---------------------+----------------------------+----------------------------+-----------------------------------+-------------+-------------------+-------------------------------+------------------------------+--------------------------------------+-----------------+-----------------------+-------------------+---------------------+------------------------------+----------------------------+-----------------+---------------+----------------------------------------+---------------+-------------------------------------------------------------------------------------+-------------+-----------+-----------------------------------------------------------------+-------------------+
| xx.xx.xx.xx | 2882 | 1 | 1 | 60476 | MAJOR_MERGE | 1710352801420115046 | 2024-03-14 02:00:47.829176 | 2024-03-14 02:00:47.838409 | YB42AC1E87E2-0006138731B1172C-0-0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | - | table_cnt=1,[MAJOR]snapshot_version=1; | | comment="merge_reason="TENANT_MAJOR";time=add_time:1710352847829041|total=9.23ms;"; | 0 | 0 | {type:"SNAPSHOT_FOR_LS_RESERVED", snapshot:1710351031448088252} | MICRO_BLOCK_LEVEL |
+----------------+----------+-----------+-------+-----------+-------------+---------------------+----------------------------+----------------------------+-----------------------------------+-------------+-------------------+-------------------------------+------------------------------+--------------------------------------+-----------------+-----------------------+-------------------+---------------------+------------------------------+----------------------------+-----------------+---------------+----------------------------------------+---------------+-------------------------------------------------------------------------------------+-------------+-----------+-----------------------------------------------------------------+-------------------+
1 row in set (0.004 sec)