Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
The GV$OB_COMPACTION_PROGRESS view displays the progress of OBServer node-level compactions in all tenants.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| SVR_IP | varchar(46) | NO | The IP address of the OBServer node. |
| SVR_PORT | bigint(20) | NO | The port number of the OBServer node. |
| TENANT_ID | bigint(20) | NO | The ID of the tenant. |
| TYPE | varchar(64) | NO | The compaction type. Valid values:
|
| ZONE | varchar(128) | NO | The zone. |
| COMPACTION_SCN | bigint(20) unsigned | NO | The major compaction version. |
| STATUS | varchar(15) | NO | The status information. |
| TOTAL_TABLET_COUNT | bigint(20) | NO | The total number of tablets. |
| UNFINISHED_TABLET_COUNT | bigint(20) | NO | The number of unfinished tablets. |
| DATA_SIZE | bigint(20) | NO | The total amount of data to scan, in bytes. |
| UNFINISHED_DATA_SIZE | bigint(20) | NO | The remaining amount of data to scan, in bytes. |
| COMPRESSION_RATIO | double | NO | The compression ratio of the data that has been written since the last major compaction version. |
| START_TIME | timestamp(6) | NO | The start time. |
| ESTIMATED_FINISH_TIME | timestamp(6) | NO | The estimated time when the compaction ends. If COMPACTION_PROGRESS is displayed as 100, the compaction end time is displayed. |
| COMMENTS | varchar(1024) | NO | The description of the window. If the compaction is in progress, the current latest compaction event is recorded. If the compaction is completed, the overall time consumption is recorded. |
Sample query
The following example shows how to query the tablet-level compaction progress information of all tenants in the sys tenant and display the first 10 records:
obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_COMPACTION_PROGRESS LIMIT 10;
The query result is as follows:
+----------------+----------+-----------+-------------+-------+---------------------+--------+--------------------+-------------------------+-----------+----------------------+-------------------+----------------------------+----------------------------+--------------------------------------------------------------+
| SVR_IP | SVR_PORT | TENANT_ID | TYPE | ZONE | COMPACTION_SCN | STATUS | TOTAL_TABLET_COUNT | UNFINISHED_TABLET_COUNT | DATA_SIZE | UNFINISHED_DATA_SIZE | COMPRESSION_RATIO | START_TIME | ESTIMATED_FINISH_TIME | COMMENTS |
+----------------+----------+-----------+-------------+-------+---------------------+--------+--------------------+-------------------------+-----------+----------------------+-------------------+----------------------------+----------------------------+--------------------------------------------------------------+
| 172.xx.xxx.xxx | 2882 | 1 | MAJOR_MERGE | zone1 | 1735668001977989000 | FINISH | 998 | 0 | 52950720 | 0 | 1 | 2025-01-01 02:00:03.437780 | 2025-01-01 02:06:08.668990 | EXECUTE=2.77s|(0.40)|UPDATE_TABLET=3.65s|(0.53)|total=6.91s; |
| 172.xx.xxx.xxx | 2882 | 1 | MAJOR_MERGE | zone1 | 1735754403442116000 | FINISH | 998 | 0 | 383450742 | 0 | 1 | 2025-01-02 02:00:05.586452 | 2025-01-02 02:04:40.953585 | EXECUTE=4.27s|(0.48)|UPDATE_TABLET=4.08s|(0.46)|total=8.87s; |
| 172.xx.xxx.xxx | 2882 | 1001 | MAJOR_MERGE | zone1 | 1735668001678185000 | FINISH | 0 | 0 | 0 | 0 | 1 | 2025-01-01 02:00:03.771773 | 2025-01-01 02:01:27.731708 | total=0us; |
| 172.xx.xxx.xxx | 2882 | 1001 | MAJOR_MERGE | zone1 | 1735754403233853000 | FINISH | 0 | 0 | 0 | 0 | 1 | 2025-01-02 02:00:04.882274 | 2025-01-02 02:01:28.675352 | total=0us; |
| 172.xx.xxx.xxx | 2882 | 1002 | MAJOR_MERGE | zone1 | 1735668000499972000 | FINISH | 3 | 0 | 0 | 0 | 1 | 2025-01-01 02:00:02.047807 | 2025-01-01 02:03:28.380519 | total=14.70ms; |
| 172.xx.xxx.xxx | 2882 | 1002 | MAJOR_MERGE | zone1 | 1735754402003130000 | FINISH | 3 | 0 | 0 | 0 | 1 | 2025-01-02 02:00:04.119302 | 2025-01-02 02:03:31.626016 | total=9.92ms; |
| 172.xx.xxx.xxx | 2882 | 1003 | MAJOR_MERGE | zone1 | 1735668004226090000 | FINISH | 0 | 0 | 0 | 0 | 1 | 2025-01-01 02:00:06.893806 | 2025-01-01 02:00:16.332080 | total=0us; |
| 172.xx.xxx.xxx | 2882 | 1003 | MAJOR_MERGE | zone1 | 1735754400772624001 | FINISH | 0 | 0 | 0 | 0 | 1 | 2025-01-02 02:00:02.558164 | 2025-01-02 02:00:17.266716 | total=0us; |
| 172.xx.xxx.xxx | 2882 | 1004 | MAJOR_MERGE | zone1 | 1735668003058920000 | FINISH | 2 | 0 | 0 | 0 | 1 | 2025-01-01 02:00:03.770432 | 2025-01-01 02:02:16.903124 | total=6.93ms; |
| 172.xx.xxx.xxx | 2882 | 1004 | MAJOR_MERGE | zone1 | 1735754404488391000 | FINISH | 2 | 0 | 0 | 0 | 1 | 2025-01-02 02:00:07.115160 | 2025-01-02 02:02:20.064100 | total=5.81ms; |
+----------------+----------+-----------+-------------+-------+---------------------+--------+--------------------+-------------------------+-----------+----------------------+-------------------+----------------------------+----------------------------+--------------------------------------------------------------+
10 rows in set