Note
This view is available starting with V4.0.0.
Purpose
This view displays the history of tablet-level compactions for all tenants 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 ID of the tenant. |
| LS_ID | bigint(20) | NO | The ID of the log stream. |
| TABLET_ID | bigint(20) | NO | The ID of the data tablet. |
| 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 trace of the task. |
| OCCUPY_SIZE | bigint(20) | NO | The size of the 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 new macroblocks. |
| MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO | bigint(20) | NO | The number of reused microblocks in new macroblocks. |
| 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 calculated as the ratio of the compressed size to the original size of the new macroblocks. |
| 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, this column 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. This column displays the statistical information about the amount of data scanned, the running time, and the amount of output data of the parallel tasks, including the minimum, maximum, and average values. |
| PARTICIPANT_TABLE | varchar(512) | NO | The information about the tables involved in the current compaction. |
| MACRO_ID_LIST | varchar(256) | NO | The list of output macroblocks. If the list is too long, it is not displayed. |
| COMMENTS | varchar(256) | NO | The information about failed compactions and the time taken for the current compaction. |
Sample query
Query the history of tablet-level compactions for tenant 1002 on all nodes. Display the first five records.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_TABLET_COMPACTION_HISTORY WHERE TENANT_ID=1002 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 | 1003 | 200002 | MAJOR_MERGE | 1735668000499972000 | 2025-01-01 02:01:29.416071 | 2025-01-01 02:01:29.416852 | YB42AC1E87ED-00062A8B78BCF056-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=5.09ms;"; |
| 172.xx.xxx.xxx | 2882 | 1002 | 1003 | 200006 | MAJOR_MERGE | 1735668000499972000 | 2025-01-01 02:01:29.416135 | 2025-01-01 02:01:29.416738 | YB42AC1E87ED-00062A8B78BCF058-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=5.03ms;"; |
| 172.xx.xxx.xxx | 2882 | 1002 | 1003 | 200005 | MAJOR_MERGE | 1735668000499972000 | 2025-01-01 02:01:29.416093 | 2025-01-01 02:01:29.416771 | YB42AC1E87ED-00062A8B78BCF057-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.51ms;"; |
| 172.xx.xxx.xxx | 2882 | 1002 | 1003 | 200002 | MAJOR_MERGE | 1735754402003130000 | 2025-01-02 02:01:33.804381 | 2025-01-02 02:01:33.805027 | YB42AC1E87ED-00062A8B78BCF060-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.46ms;"; |
| 172.xx.xxx.xxx | 2882 | 1002 | 1003 | 200005 | MAJOR_MERGE | 1735754402003130000 | 2025-01-02 02:01:33.804133 | 2025-01-02 02:01:33.804869 | YB42AC1E87ED-00062A8B78BCF05F-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.81ms;"; |
+----------------+----------+-----------+-------+-----------+-------------+---------------------+----------------------------+----------------------------+-----------------------------------+-------------+-------------------+-------------------------------+------------------------------+--------------------------------------+-----------------+-----------------------+-------------------+---------------------+------------------------------+----------------------------+-----------------+---------------+----------------------------------------------------------+---------------+----------------------------------------+
5 rows in set
References
- View the detailed history of tablet-level compactions on the current node: V$OB_TABLET_COMPACTION_HISTORY