Note
This view is available starting with V4.0.0.
Purpose
This view displays the history of tablet-level compactions for the current tenant on all nodes.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| SVR_IP | varchar(46) | NO | The IP address of the server. |
| SVR_PORT | bigint(20) | NO | The port number of the server. |
| TENANT_ID | bigint(20) | NO | The tenant ID. |
| LS_ID | bigint(20) | NO | The log stream ID. |
| TABLET_ID | bigint(20) | NO | The tablet ID. |
| TYPE | varchar(64) | NO | The type of compaction. Valid values:
|
| COMPACTION_SCN | bigint(20) unsigned | NO | The 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 size of the data. |
| MACRO_BLOCK_COUNT | bigint(20) | NO | The number of macro blocks. |
| MULTIPLEXED_MACRO_BLOCK_COUNT | bigint(20) | NO | The number of reused macro blocks. |
| NEW_MICRO_COUNT_IN_NEW_MACRO | bigint(20) | NO | The number of new micro blocks in the new macro block. |
| MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO | bigint(20) | NO | The number of reused micro blocks in the new macro block. |
| 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 the new data. The compression ratio is the ratio of the size of the compressed data to the size of the data before compression. |
| NEW_FLUSH_DATA_RATE | bigint(20) | NO | The output speed of the new data, in KB/s. |
| PROGRESSIVE_COMPACTION_ROUND | bigint(20) | NO | The current round of progressive compaction. If the compaction is a full compaction, the value is -1. |
| PROGRESSIVE_COMPACTION_NUM | bigint(20) | NO | The total number of rounds of progressive compaction. |
| PARALLEL_DEGREE | bigint(20) | NO | The parallelism. |
| PARALLEL_INFO | varchar(512) | NO | The information about the parallel tasks, including the statistics of the data scanned, running time, and output data of the parallel tasks (minimum, maximum, and average values). |
| PARTICIPANT_TABLE | varchar(512) | NO | The information about the tables involved in the compaction. |
| MACRO_ID_LIST | varchar(256) | NO | The list of output macro blocks. If the list is too long, it will not be displayed. |
| COMMENTS | varchar(256) | NO | The information about failed compactions and the duration of the current compaction. |
Sample query
Query the history of tablet-level compactions for the current tenant on all nodes and display the first five records.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_TABLET_COMPACTION_HISTORY LIMIT 5;
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 |
+----------------+----------+-----------+-------+-----------+-------------+---------------------+----------------------------+----------------------------+-----------------------------------+-------------+-------------------+-------------------------------+------------------------------+--------------------------------------+-----------------+-----------------------+-------------------+---------------------+------------------------------+----------------------------+-----------------+---------------+----------------------------------------------------------+---------------+----------------------------------------+
| 172.xx.xxx.xxx | 2882 | 1002 | 1002 | 200001 | MAJOR_MERGE | 1735668000499972000 | 2025-01-01 02:01:29.117128 | 2025-01-01 02:01:29.117776 | YB42AC1E87E3-00062A8B7FB71A82-0-0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | - | table_cnt=1,[MAJOR]snapshot_version=1; | | extra_info="time_guard=total=6.48ms;"; |
| 172.xx.xxx.xxx | 2882 | 1002 | 1002 | 200008 | MAJOR_MERGE | 1735668000499972000 | 2025-01-01 02:01:29.117383 | 2025-01-01 02:01:29.118068 | YB42AC1E87E3-00062A8B7FB71A84-0-0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | - | table_cnt=1,[MAJOR]snapshot_version=1; | | extra_info="time_guard=total=8.29ms;"; |
| 172.xx.xxx.xxx | 2882 | 1002 | 1002 | 200004 | MAJOR_MERGE | 1735668000499972000 | 2025-01-01 02:01:29.117143 | 2025-01-01 02:01:29.117783 | YB42AC1E87E3-00062A8B7FB71A83-0-0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | - | table_cnt=1,[MAJOR]snapshot_version=1; | | extra_info="time_guard=total=8.76ms;"; |
| 172.xx.xxx.xxx | 2882 | 1002 | 1002 | 200004 | MAJOR_MERGE | 1735754402003130000 | 2025-01-02 02:01:33.552858 | 2025-01-02 02:01:33.553673 | YB42AC1E87E3-00062A8B7FB71A8B-0-0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | - | table_cnt=1,[MAJOR]snapshot_version=1735668000499972000; | | extra_info="time_guard=total=4.93ms;"; |
| 172.xx.xxx.xxx | 2882 | 1002 | 1002 | 200001 | MAJOR_MERGE | 1735754402003130000 | 2025-01-02 02:01:33.553428 | 2025-01-02 02:01:33.554078 | YB42AC1E87E3-00062A8B7FB71A8D-0-0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | - | table_cnt=1,[MAJOR]snapshot_version=1735668000499972000; | | extra_info="time_guard=total=5.62ms;"; |
+----------------+----------+-----------+-------+-----------+-------------+---------------------+----------------------------+----------------------------+-----------------------------------+-------------+-------------------+-------------------------------+------------------------------+--------------------------------------+-----------------+-----------------------+-------------------+---------------------+------------------------------+----------------------------+-----------------+---------------+----------------------------------------------------------+---------------+----------------------------------------+
5 rows in set
References
- View the detailed history of tablet-level compactions on the current node: V$OB_TABLET_COMPACTION_HISTORY