Note
Starting from V4.0.0, the view V$MERGE_INFO is renamed to V$OB_MERGE_INFO. In V4.0.0 and later, you must use the new view name V$OB_MERGE_INFO to query the view. If you use the old view name V$MERGE_INFO to query the view, an error will occur.
Description
Displays the statistics of completed compactions in the OceanBase cluster.
Field descriptions
| Field name | 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 shard. |
| ACTION | varchar(64) | NO | The specific action of the compaction.
|
| COMPACTION_SCN | bigint(20) unsigned | NO | The version number of the compaction. |
| START_TIME | timestamp(6) | NO | The start time of the compaction. |
| END_TIME | timestamp(6) | NO | The end time of the compaction. |
| MACRO_BLOCK_COUNT | bigint(20) | NO | The total number of macroblocks in the compaction. |
| REUSE_PCT | decimal(26,2) | NO | The reuse rate of macroblocks in the compaction. |
| PARALLEL_DEGREE | bigint(20) | NO | The degree of parallelism of the compaction. |
Example
Observe the statistics of the completed minor compactions (MINI_MERGE) in a MySQL user tenant and return the first five records.
obclient [oceanbase]> SELECT * FROM oceanbase.V$OB_MERGE_INFO WHERE ACTION='MINI_MERGE' LIMIT 5;
The query result is as follows:
+----------------+----------+-----------+-------+-----------+------------+---------------------+----------------------------+----------------------------+-------------------+-----------+-----------------+
| SVR_IP | SVR_PORT | TENANT_ID | LS_ID | TABLET_ID | ACTION | COMPACTION_SCN | START_TIME | END_TIME | MACRO_BLOCK_COUNT | REUSE_PCT | PARALLEL_DEGREE |
+----------------+----------+-----------+-------+-----------+------------+---------------------+----------------------------+----------------------------+-------------------+-----------+-----------------+
| 172.xx.xxx.xxx | 2882 | 1002 | 1 | 49402 | MINI_MERGE | 1712895545480643155 | 2024-04-12 12:19:06.285433 | 2024-04-12 12:19:06.292896 | 1 | 0.00 | 1 |
| 172.xx.xxx.xxx | 2882 | 1002 | 1 | 49401 | MINI_MERGE | 1712895546279349 | 2024-04-12 12:19:06.279509 | 2024-04-12 12:19:06.361253 | 1 | 0.00 | 1 |
| 172.xx.xxx.xxx | 2882 | 1002 | 1 | 101001 | MINI_MERGE | 1712895545892669938 | 2024-04-12 12:19:10.331618 | 2024-04-12 12:19:10.335477 | 1 | 0.00 | 1 |
| 172.xx.xxx.xxx | 2882 | 1002 | 1 | 100006 | MINI_MERGE | 1712895545892669938 | 2024-04-12 12:19:10.331718 | 2024-04-12 12:19:10.335799 | 1 | 0.00 | 1 |
| 172.xx.xxx.xxx | 2882 | 1002 | 1 | 5 | MINI_MERGE | 1712895545892669938 | 2024-04-12 12:19:10.331664 | 2024-04-12 12:19:10.337510 | 1 | 0.00 | 1 |
+----------------+----------+-----------+-------+-----------+------------+---------------------+----------------------------+----------------------------+-------------------+-----------+-----------------+
5 rows in set