Note
This view is available starting with V4.0.0.
Purpose
This view displays the major compaction information of each zone for all tenants in the sys tenant.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The ID of the tenant. |
| ZONE | varchar(128) | NO | The name of the zone. |
| BROADCAST_SCN | bigint(20) unsigned | NO | The version number of the major compaction that is broadcast. |
| LAST_SCN | bigint(20) unsigned | NO | The version number of the last major compaction. |
| LAST_FINISH_TIME | timestamp(6) | NO | The end time of the last major compaction. |
| START_TIME | timestamp(6) | NO | The start time of the major compaction. |
| STATUS | varchar(10) | NO |
|
Sample query
Query the major compaction information of each zone for all tenants in the sys tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_ZONE_MAJOR_COMPACTION;
The query result is as follows:
+-----------+-------+---------------------+---------------------+----------------------------+----------------------------+------------+
| TENANT_ID | ZONE | BROADCAST_SCN | LAST_SCN | LAST_FINISH_TIME | START_TIME | STATUS |
+-----------+-------+---------------------+---------------------+----------------------------+----------------------------+------------+
| 1 | zone1 | 1736445603362416000 | 1736445603362416000 | 2025-01-10 02:02:17.252947 | 2025-01-10 02:00:03.403496 | IDLE |
| 1001 | zone1 | 1736445600816385000 | 1736445600816385000 | 2025-01-10 02:03:14.949900 | 2025-01-10 02:00:00.862396 | IDLE |
| 1002 | zone1 | 1736474754101535000 | 1736445604784833000 | 2025-01-10 02:03:18.264375 | 2025-01-10 10:05:54.190295 | COMPACTING |
| 1003 | zone1 | 1736445604438949000 | 1736445604438949000 | 2025-01-10 02:02:38.148380 | 2025-01-10 02:00:04.468472 | IDLE |
| 1004 | zone1 | 1736474754113143000 | 1736445603654676000 | 2025-01-10 02:02:16.603847 | 2025-01-10 10:05:54.176065 | COMPACTING |
| 1009 | zone1 | 1736445600541986000 | 1736445600541986000 | 2025-01-10 02:03:14.573029 | 2025-01-10 02:00:00.572544 | IDLE |
| 1010 | zone1 | 1736474754124224000 | 1736445604569016000 | 2025-01-10 02:01:37.485964 | 2025-01-10 10:05:54.223059 | COMPACTING |
| 1015 | zone1 | 1736445603595594000 | 1736445603595594000 | 2025-01-10 02:03:47.522524 | 2025-01-10 02:00:03.630661 | IDLE |
| 1016 | zone1 | 1736359203243332000 | 1736359203243332000 | 2025-01-09 02:05:33.677564 | 2025-01-09 02:01:59.460165 | IDLE |
+-----------+-------+---------------------+---------------------+----------------------------+----------------------------+------------+
9 rows in set
References
Query the global major compaction information of all tenants: CDB_OB_MAJOR_COMPACTION
Query the basic statistics of major compactions at the tablet level:
Query the detailed historical information about major compactions at the tablet level:
For information about major compaction operations, see the following topics: