V$OB_TABLET_COMPACTION_HISTORY

2025-12-04 07:10:03  Updated

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 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 tenant ID.
LS_ID bigint(20) NO The log stream ID.
TABLET_ID bigint(20) NO The data tablet ID.
TYPE varchar(64) NO The type of compaction. Valid values:
  • MDS_TABLE_MERGE: persists the system metadata in the SSTable format to disk.
  • MAJOR_MERGE: tenant-level compaction.
  • MEDIUM_MERGE: partition-level compaction.
  • MINI_MERGE: mini compaction. Converts a MemTable to a mini SSTable.
  • MINOR_MERGE: minor compaction. Combines multiple mini SSTables into a new mini SSTable or combines multiple mini SSTables with a minor SSTable into a new minor SSTable.
  • META_MAJOR_MERGE: a special type of compaction. Combines the data before a specified time point into a Meta Major SSTable. The data format is the same as that of a Major SSTable, and the data does not contain multi-version data or uncommitted transaction data.
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 data size.
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 new data = the ratio of the compressed data size to the original data size 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 number of rounds of progressive compaction.
PARALLEL_DEGREE bigint(20) NO The parallelism.
PARALLEL_INFO varchar(512) NO The information about parallel tasks. It displays the statistics of the scanned data volume, running time, and output data volume of 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 macroblocks. If the list is too long, it will not be displayed.
COMMENTS varchar(256) NO The information about failed compactions and the time spent on the current compaction.

Sample query

Query the history of tablet-level compactions for the current tenant on the current node and display the first five records.

obclient [oceanbase]> SELECT * FROM oceanbase.V$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

Contact Us