Note
This view is available starting with V4.0.0.
Purpose
This view displays the history of tablet-level compactions for all tenants on the current node.
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 data. |
| MACRO_BLOCK_COUNT | bigint(20) | NO | The number of macroblocks. |
| MULTIPLEXED_MACRO_BLOCK_COUNT | bigint(20) | NO | The number of macroblocks that are reused. |
| 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 microblocks that are reused 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 new data = (size of compressed data in new macroblocks)/(size of data in new macroblocks) |
| 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 the compaction is a full compaction, this column is -1. |
| PROGRESSIVE_COMPACTION_NUM | bigint(20) | NO | The total rounds of progressive compaction. |
| PARALLEL_DEGREE | bigint(20) | NO | The parallelism. |
| PARALLEL_INFO | varchar(512) | NO | The information about parallel tasks. The information includes the statistics of the amount of data scanned, running time, and output data of parallel tasks. The statistics include 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 macroblocks. If the list is too long, it will not be displayed. |
| COMMENTS | varchar(256) | NO | The information about failed compactions and the collection of the duration of the current compaction. |
Sample query
Query the history of tablet-level compactions for the tenant with ID 1002 on the current node, and display the first five records.
obclient [oceanbase]> SELECT * FROM oceanbase.V$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 | 1 | 50192 | MAJOR_MERGE | 1735668000499972000 | 2025-01-01 02:01:30.261474 | 2025-01-01 02:01:30.262600 | YB42AC1E87E4-00062A8B74EABDA7-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.91ms;"; |
| 172.xx.xxx.xxx | 2882 | 1002 | 1 | 60379 | MAJOR_MERGE | 1735668000499972000 | 2025-01-01 02:01:30.261157 | 2025-01-01 02:01:30.261933 | YB42AC1E87E4-00062A8B74EABDA4-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=7.62ms;"; |
| 172.xx.xxx.xxx | 2882 | 1002 | 1 | 50380 | MAJOR_MERGE | 1735668000499972000 | 2025-01-01 02:01:30.261134 | 2025-01-01 02:01:30.261940 | YB42AC1E87E4-00062A8B74EABDA3-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=7.81ms;"; |
| 172.xx.xxx.xxx | 2882 | 1002 | 1 | 60259 | MAJOR_MERGE | 1735668000499972000 | 2025-01-01 02:01:30.261783 | 2025-01-01 02:01:30.262687 | YB42AC1E87E4-00062A8B74EABDA9-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=7.63ms;"; |
| 172.xx.xxx.xxx | 2882 | 1002 | 1 | 233 | MAJOR_MERGE | 1735668000499972000 | 2025-01-01 02:01:30.261812 | 2025-01-01 02:01:30.262700 | YB42AC1E87E4-00062A8B74EABDAA-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=7.94ms;"; |
+----------------+----------+-----------+-------+-----------+-------------+---------------------+----------------------------+----------------------------+-----------------------------------+-------------+-------------------+-------------------------------+------------------------------+--------------------------------------+-----------------+-----------------------+-------------------+---------------------+------------------------------+----------------------------+-----------------+---------------+----------------------------------------+---------------+----------------------------------------+
5 rows in set
References
- GV$OB_TABLET_COMPACTION_HISTORY: View the detailed history of tablet-level compactions on all nodes.