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 the current tenant.
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 amount of data that does not need to be scanned, 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 completion time. If COMPACTION_PROGRESS is displayed as 100, the compaction end time is displayed. |
| COMMENTS | varchar(1024) | NO | The description of the window. The comments record the latest compaction event during major compaction. If the major compaction is completed, the comments record the overall major compaction performance. |
Sample query
View the major compaction progress of a user tenant on all nodes.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_COMPACTION_PROGRESS;
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 | 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 | 1002 | MAJOR_MERGE | zone1 | 1735668000499972000 | FINISH | 674 | 0 | 14286277 | 0 | 1 | 2025-01-01 02:00:01.838509 | 2025-01-01 02:05:35.000980 | EXECUTE=1.09s|(0.29)|UPDATE_TABLET=2.34s|(0.63)|total=3.70s; |
| 172.xx.xxx.xxx | 2882 | 1002 | MAJOR_MERGE | zone1 | 1735754402003130000 | FINISH | 674 | 0 | 147252410 | 0 | 1 | 2025-01-02 02:00:04.963585 | 2025-01-02 02:05:58.968389 | EXECUTE=1.02s|(0.34)|UPDATE_TABLET=1.79s|(0.59)|total=3.04s; |
| 172.xx.xxx.xxx | 2882 | 1002 | MAJOR_MERGE | zone1 | 1735840803495668000 | FINISH | 674 | 0 | 153324237 | 0 | 1 | 2025-01-03 02:00:05.266161 | 2025-01-03 02:04:23.368339 | EXECUTE=1.06s|(0.34)|UPDATE_TABLET=1.77s|(0.58)|total=3.07s; |
| 172.xx.xxx.xxx | 2882 | 1002 | MAJOR_MERGE | zone1 | 1735668000499972000 | FINISH | 3 | 0 | 0 | 0 | 1 | 2025-01-01 02:00:03.010621 | 2025-01-01 02:03:28.752341 | total=10.98ms; |
| 172.xx.xxx.xxx | 2882 | 1002 | MAJOR_MERGE | zone1 | 1735754402003130000 | FINISH | 3 | 0 | 0 | 0 | 1 | 2025-01-02 02:00:02.698221 | 2025-01-02 02:03:32.172298 | total=11.37ms; |
| 172.xx.xxx.xxx | 2882 | 1002 | MAJOR_MERGE | zone1 | 1735840803495668000 | FINISH | 3 | 0 | 0 | 0 | 1 | 2025-01-03 02:00:05.081330 | 2025-01-03 02:03:35.565819 | total=11.29ms; |
+----------------+----------+-----------+-------------+-------+---------------------+--------+--------------------+-------------------------+-----------+----------------------+-------------------+----------------------------+----------------------------+--------------------------------------------------------------+
8 rows in set