Note
The view V$MERGE_INFO was renamed to V$OB_MERGE_INFO starting from V4.0.0. In V4.0.0 and later versions, you must use the new view name V$OB_MERGE_INFO to query. Using the old view name V$MERGE_INFO will result in an error.
Purpose
This view displays the statistics of compactions that have been completed in an OceanBase cluster.
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. |
| ACTION | varchar(64) | NO | The type of the compaction.
|
| COMPACTION_SCN | bigint(20) unsigned | NO | The compaction version number. |
| 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 macroblock reuse rate of the compaction. |
| PARALLEL_DEGREE | bigint(20) | NO | The parallelism of the compaction. |
Sample query
Query the statistics of MINI_MERGE operations that have been completed in the cluster as the sys 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 | 1 | 1 | 49402 | MINI_MERGE | 1712895419824894939 | 2024-04-12 12:16:59.926830 | 2024-04-12 12:16:59.967716 | 1 | 0.00 | 1 |
| 172.xx.xxx.xxx | 2882 | 1 | 1 | 49401 | MINI_MERGE | 1712895419920179 | 2024-04-12 12:16:59.920432 | 2024-04-12 12:17:00.029272 | 1 | 0.00 | 1 |
| 172.xx.xxx.xxx | 2882 | 1 | 1 | 344 | MINI_MERGE | 1712895419824894940 | 2024-04-12 12:17:03.973219 | 2024-04-12 12:17:03.978389 | 1 | 0.00 | 1 |
| 172.xx.xxx.xxx | 2882 | 1 | 1 | 101001 | MINI_MERGE | 1712895419824894940 | 2024-04-12 12:17:03.973125 | 2024-04-12 12:17:03.979416 | 1 | 0.00 | 1 |
| 172.xx.xxx.xxx | 2882 | 1 | 1 | 372 | MINI_MERGE | 1712895419824894940 | 2024-04-12 12:17:03.973250 | 2024-04-12 12:17:03.979160 | 1 | 0.00 | 1 |
+----------------+----------+-----------+-------+-----------+------------+---------------------+----------------------------+----------------------------+-------------------+-----------+-----------------+
5 rows in set
References
- Query the statistics of compactions that have been completed in all tenants on all nodes: GV$OB_MERGE_INFO
Query the history of tablet-level compactions on the current node for all tenants: V$OB_TABLET_COMPACTION_HISTORY
Query the major compaction information of all tenants in each zone: CDB_OB_ZONE_MAJOR_COMPACTION
Query the global major compaction information of all tenants: CDB_OB_MAJOR_COMPACTION