Overview
This API is used to query the statistics of completed compactions in an OceanBase AI Database cluster.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| SVR_IP | varchar(46) | NO | Server IP Address |
| SVR_PORT | bigint(20) | NO | Server Port Number |
| TENANT_ID | bigint(20) | NO | Tenant ID |
| LS_ID | bigint(20) | NO | Log Stream ID |
| TABLET_ID | bigint(20) | NO | Data Shard ID |
| ACTION | varchar(64) | NO | Compaction actions:
|
| COMPACTION_SCN | bigint(20) unsigned | NO | Compaction Version |
| START_TIME | timestamp(6) | NO | Compaction Start Time |
| END_TIME | timestamp(6) | NO | Compaction End Time |
| MACRO_BLOCK_COUNT | bigint(20) | NO | Total Number of Compaction Macroblocks |
| REUSE_PCT | decimal(26,2) | NO | Compaction Macroblock Reuse Rate |
| PARALLEL_DEGREE | bigint(20) | NO | Compaction Parallelism |
Sample query
The sys tenant queries the statistics on completed minor compactions (MINI_MERGE) in the cluster and returns the first five records.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$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
View statistics related to completed compactions on the current node for all tenants: V$OB_MERGE_INFO
Query the progress of tablet-level compaction for all tenants on all nodes: GV$OB_TABLET_COMPACTION_PROGRESS
View the historical information of tablet-level compactions on all nodes of all tenants: GV$OB_TABLET_COMPACTION_HISTORY
View major compaction information for all zones of all tenants: CDB_OB_ZONE_MAJOR_COMPACTION
Query global major compaction information for all tenants: CDB_OB_MAJOR_COMPACTION