After a major compaction is initiated, you can view the merge information through views.
You can view the progress of a major compaction through views. The time required for a major compaction depends on the amount of data changes between two major compactions. If a large amount of data changes occur between two major compactions, the major compaction will take longer. The number of threads for major compactions and the cluster pressure during major compactions also affect the time required for major compactions.
View major compactions of all tenants from the sys tenant
The sys tenant can observe the tenant-level and partition-level major compaction information of all tenants through views.
Log in to the
systenant of the cluster as therootuser.Run the following statement to view the major compaction information:
View the tenant-level major compaction information by using the
CDB_OB_ZONE_MAJOR_COMPACTIONorCDB_OB_MAJOR_COMPACTIONview.The
CDB_OB_ZONE_MAJOR_COMPACTIONview shows the major compaction process of all tenants in each zone.obclient> 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 | 1748368801021617000 | 1748368801021617000 | 2025-05-28 02:04:15.351286 | 2025-05-28 02:00:01.051592 | IDLE | | 1001 | zone1 | 1748368802924607000 | 1748368802924607000 | 2025-05-28 02:02:16.412661 | 2025-05-28 02:00:02.965810 | IDLE | | 1002 | zone1 | 1748368802035321000 | 1748368802035321000 | 2025-05-28 02:03:25.019173 | 2025-05-28 02:00:02.090687 | IDLE | | 1003 | zone1 | 1748368802977311000 | 1748368802977311000 | 2025-05-28 02:02:46.565036 | 2025-05-28 02:00:03.009192 | IDLE | | 1004 | zone1 | 1748368801786323000 | 1748368801786323000 | 2025-05-28 02:03:54.629630 | 2025-05-28 02:00:01.820863 | IDLE | +-----------+-------+---------------------+---------------------+----------------------------+----------------------------+--------+ 5 rows in setObserve the
statuscolumn in the execution result. The following table describes some columns.Column Description TENANT_ID Tenant ID. ZONE Zone name. BROADCAST_SCN Broadcasted major compaction version number. LAST_SCN Version number of the last major compaction. LAST_FINISH_TIME End time of the last major compaction. START_TIME Start time of the major compaction. STATUS Major compaction status: IDLE: not in major compaction.COMPACTING: major compaction is in progress.VERIFYING: checksum verification is in progress.
The
CDB_OB_MAJOR_COMPACTIONview shows the global major compaction information of all tenants.obclient> SELECT * FROM oceanbase.CDB_OB_MAJOR_COMPACTION;The query result is as follows:
+-----------+---------------------+----------------------------+----------------------+---------------------+----------------------------+----------------------------+--------+----------+--------------+------+ | TENANT_ID | FROZEN_SCN | FROZEN_TIME | GLOBAL_BROADCAST_SCN | LAST_SCN | LAST_FINISH_TIME | START_TIME | STATUS | IS_ERROR | IS_SUSPENDED | INFO | +-----------+---------------------+----------------------------+----------------------+---------------------+----------------------------+----------------------------+--------+----------+--------------+------+ | 1 | 1748368801021617000 | 2025-05-28 02:00:01.021617 | 1748368801021617000 | 1748368801021617000 | 2025-05-28 02:04:15.380802 | 2025-05-28 02:00:01.042282 | IDLE | NO | NO | | | 1001 | 1748368802924607000 | 2025-05-28 02:00:02.924607 | 1748368802924607000 | 1748368802924607000 | 2025-05-28 02:02:16.440351 | 2025-05-28 02:00:02.957000 | IDLE | NO | NO | | | 1002 | 1748368802035321000 | 2025-05-28 02:00:02.035321 | 1748368802035321000 | 1748368802035321000 | 2025-05-28 02:03:25.035666 | 2025-05-28 02:00:02.075224 | IDLE | NO | NO | | | 1003 | 1748368802977311000 | 2025-05-28 02:00:02.977311 | 1748368802977311000 | 1748368802977311000 | 2025-05-28 02:02:46.592681 | 2025-05-28 02:00:03.003544 | IDLE | NO | NO | | | 1004 | 1748368801786323000 | 2025-05-28 02:00:01.786323 | 1748368801786323000 | 1748368801786323000 | 2025-05-28 02:03:54.645389 | 2025-05-28 02:00:01.809475 | IDLE | NO | NO | | +-----------+---------------------+----------------------------+----------------------+---------------------+----------------------------+----------------------------+--------+----------+--------------+------+ 5 rows in setObserve the
statuscolumn in the execution result. The following table describes some parameters.Column Description TENANT_ID Tenant ID. FROZEN_SCN Version number of the last major compaction. FROZEN_TIME Readable time type of FROZEN_SCN.GLOBAL_BROADCAST_SCN Global broadcasted major compaction version number. LAST_SCN Version number of the last completed major compaction. LAST_FINISH_TIME End time of the last major compaction. START_TIME Start time of the major compaction. STATUS Major compaction status: IDLE: not in major compaction.COMPACTING: major compaction is in progress.VERIFYING: checksum verification is in progress.
IS_ERROR - YES: an error occurred during the major compaction.
- NO: no error occurred during the major compaction.
IS_SUSPENDED - YES: the major compaction was suspended.
- NO: the major compaction was not suspended.
INFO Displays the major compaction information. View the partition-level major compaction information by using the
GV$OB_MERGE_INFOorGV$OB_TABLET_COMPACTION_HISTORYview.The
GV$OB_MERGE_INFOview shows the basic statistics of tablet major compactions.obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_MERGE_INFO WHERE TENANT_ID=1002 AND TABLET_ID=200001 ORDER BY START_TIME DESC LIMIT 10;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 | 1002 | 1001 | 200001 | MAJOR_MERGE | 1706119204801812283 | 2024-01-25 02:03:03.876629 | 2024-01-25 02:03:03.929758 | 0 | 0.00 | 1 | | 172.xx.xxx.xxx | 2882 | 1002 | 1001 | 200001 | MDS_TABLE_MERGE | 1706086731631303497 | 2024-01-24 16:58:52.078436 | 2024-01-24 16:58:52.080722 | 0 | 0.00 | 0 | | 172.xx.xxx.xxx | 2882 | 1002 | 1001 | 200001 | MEDIUM_MERGE | 1706086435242718629 | 2024-01-24 16:56:57.297697 | 2024-01-24 16:56:57.305654 | 0 | 0.00 | 1 | | 172.xx.xxx.xxx | 2882 | 1002 | 1001 | 200001 | MDS_TABLE_MERGE | 1706086356639492056 | 2024-01-24 16:52:37.067139 | 2024-01-24 16:52:37.069771 | 0 | 0.00 | 0 | +----------------+----------+-----------+-------+-----------+-----------------+---------------------+----------------------------+----------------------------+-------------------+-----------+-----------------+ 4 rows in setThe values in the
ACTIONcolumn have the following meanings:MDS_TABLE_MERGE: persists the system metadata to disk in the format of an SSTable.MAJOR_MERGE: tenant-level major compaction.MEDIUM_MERGE: partition-level major compaction.MINI_MERGE: mini compaction, which converts the MemTable to a mini SSTable.MINOR_MERGE: minor compaction, which combines multiple mini SSTables into one or combines multiple mini SSTables with one minor SSTable into one new minor SSTable.META_MAJOR_MERGE: a special compaction type that synthesizes data before a specified point in time into one meta major SSTable. The data format of the meta major SSTable is the same as that of a major SSTable, and it does not contain multi-version data or uncommitted transaction data.
For more information about other columns in the
GV$OB_MERGE_INFOview, see GV$OB_MERGE_INFO.The
GV$OB_TABLET_COMPACTION_HISTORYview shows the detailed history of tablet major compactions.obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_TABLET_COMPACTION_HISTORY WHERE TENANT_ID=1002 AND TABLET_ID=200001 ORDER BY START_TIME DESC LIMIT 10;The query result is as follows:
+----------------+----------+-----------+-------+-----------+-----------------+---------------------+----------------------------+----------------------------+-----------------------------------+-------------+-------------------+-------------------------------+------------------------------+--------------------------------------+-----------------+-----------------------+-------------------+---------------------+------------------------------+----------------------------+-----------------+---------------+----------------------------------------------------------+---------------+-----------------------------------------------------------------------------------------------------------+-------------+-----------+----------------------------------------------------------------+-------------------+ | SVR_IP | SVR_PORT | TENANT_ID | LS_ID | TABLET_ID | TYPE | COMPACTION_SCN | START_TIME | FINISH_TIME | TASK_ID | OCCUPY_SIZE | MACRO_BLOCK_COUNT | MULTIPLEXED_MACRO_BLOCK_COUNT | NEW_MICRO_COUNT_IN_NEW_MACRO | MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO | TOTAL_ROW_COUNT | INCREMENTAL_ROW_COUNT | COMPRESSION_RATIO | NEW_FLUSH_DATA_RATE | PROGRESSIVE_COMPACTION_ROUND | PROGRESSIVE_COMPACTION_NUM | PARALLEL_DEGREE | PARALLEL_INFO | PARTICIPANT_TABLE | MACRO_ID_LIST | COMMENTS | START_CG_ID | END_CG_ID | KEPT_SNAPSHOT | MERGE_LEVEL | +----------------+----------+-----------+-------+-----------+-----------------+---------------------+----------------------------+----------------------------+-----------------------------------+-------------+-------------------+-------------------------------+------------------------------+--------------------------------------+-----------------+-----------------------+-------------------+---------------------+------------------------------+----------------------------+-----------------+---------------+----------------------------------------------------------+---------------+-----------------------------------------------------------------------------------------------------------+-------------+-----------+----------------------------------------------------------------+-------------------+ | 172.xx.xxx.xxx | 2882 | 1002 | 1001 | 200001 | MAJOR_MERGE | 1706119204801812283 | 2024-01-25 02:03:03.876629 | 2024-01-25 02:03:03.929758 | YB42AC1E87CA-00060FAC10C57D5C-0-0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | - | table_cnt=1,[MAJOR]snapshot_version=1706086435242718629; | | comment="merge_reason="TENANT_MAJOR";time=add_time:1706119382538344|wait_schedule_time=1.34s|total=53.;"; | 0 | 0 | {type:"SNAPSHOT_UNDO_RETENTION", snapshot:1706117574893656222} | MICRO_BLOCK_LEVEL | | 172.xx.xxx.xxx | 2882 | 1002 | 1001 | 200001 | MDS_TABLE_MERGE | 1706086731631303497 | 2024-01-24 16:58:52.078436 | 2024-01-24 16:58:52.080722 | YB42AC1E87CA-00060FAC10C5797A-0-0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | - | | | comment="time=add_time:1706086732078234|total=2.29ms;"; | 0 | 0 | | MICRO_BLOCK_LEVEL | | 172.xx.xxx.xxx | 2882 | 1002 | 1001 | 200001 | MEDIUM_MERGE | 1706086435242718629 | 2024-01-24 16:56:57.297697 | 2024-01-24 16:56:57.305654 | YB42AC1E87CA-00060FAC10C57979-0-0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | - | table_cnt=1,[MAJOR]snapshot_version=1; | | comment="merge_reason="USER_REQUEST";time=add_time:1706086617297507|total=7.96ms;"; | 0 | 0 | {type:"SNAPSHOT_UNDO_RETENTION", snapshot:1706084810844670506} | MACRO_BLOCK_LEVEL | | 172.xx.xxx.xxx | 2882 | 1002 | 1001 | 200001 | MDS_TABLE_MERGE | 1706086356639492056 | 2024-01-24 16:52:37.067139 | 2024-01-24 16:52:37.069771 | YB42AC1E87CA-00060FAC10C57971-0-0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | - | | | comment="time=add_time:1706086357066962|total=2.63ms;"; | 0 | 0 | | MICRO_BLOCK_LEVEL | +----------------+----------+-----------+-------+-----------+-----------------+---------------------+----------------------------+----------------------------+-----------------------------------+-------------+-------------------+-------------------------------+------------------------------+--------------------------------------+-----------------+-----------------------+-------------------+---------------------+------------------------------+----------------------------+-----------------+---------------+----------------------------------------------------------+---------------+-----------------------------------------------------------------------------------------------------------+-------------+-----------+----------------------------------------------------------------+-------------------+ 4 rows in setThe values in the
TYPEcolumn have the following meanings:MDS_TABLE_MERGE: persists the system metadata to disk in the format of an SSTable.MAJOR_MERGE: tenant-level major compaction.MEDIUM_MERGE: partition-level major compaction.MINI_MERGE: mini compaction, which converts the MemTable to a mini SSTable.MINOR_MERGE: minor compaction, which combines multiple mini SSTables into one or combines multiple mini SSTables with one minor SSTable into one new minor SSTable.META_MAJOR_MERGE: a special compaction type that synthesizes data before a specified point in time into one meta major SSTable. The data format of the meta major SSTable is the same as that of a major SSTable, and it does not contain multi-version data or uncommitted transaction data.
For more information about other columns in the
GV$OB_TABLET_COMPACTION_HISTORYview, see GV$OB_TABLET_COMPACTION_HISTORY.
View major compaction information of the user tenant
User tenants can also view the major compaction information of the current tenant by using views.
Log in to the database as the tenant administrator of the user tenant.
Execute the following statement to view the major compaction information:
MySQL modeOracle modeView the tenant-level major compaction information of the current tenant by using the
DBA_OB_ZONE_MAJOR_COMPACTIONorDBA_OB_MAJOR_COMPACTIONview.The
DBA_OB_ZONE_MAJOR_COMPACTIONview displays the major compaction information of each zone in the current tenant.obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_ZONE_MAJOR_COMPACTION;Here is an example of the query result:
+-------+---------------------+---------------------+----------------------------+----------------------------+--------+ | ZONE | BROADCAST_SCN | LAST_SCN | LAST_FINISH_TIME | START_TIME | STATUS | +-------+---------------------+---------------------+----------------------------+----------------------------+--------+ | zone1 | 1748455202538454000 | 1748455202538454000 | 2025-05-29 02:04:34.174642 | 2025-05-29 02:00:02.679713 | IDLE | +-------+---------------------+---------------------+----------------------------+----------------------------+--------+ 1 row in setObserve the
statuscolumn in the query result. The following table describes some parameters.Parameter Description ZONE The name of the zone. BROADCAST_SCN The broadcasted major compaction version number. LAST_SCN The version number of the last major compaction. LAST_FINISH_TIME The end time of the last major compaction. START_TIME The start time of the major compaction. STATUS The major compaction status. IDLE: Not in major compaction.COMPACTING: Major compaction in progress.VERIFYING: Checking checksums.
The
DBA_OB_MAJOR_COMPACTIONview displays the global information about major compactions in the current tenant.obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_MAJOR_COMPACTION;The query result is as follows:
+---------------------+----------------------------+----------------------+---------------------+----------------------------+----------------------------+--------+----------+--------------+------+ | FROZEN_SCN | FROZEN_TIME | GLOBAL_BROADCAST_SCN | LAST_SCN | LAST_FINISH_TIME | START_TIME | STATUS | IS_ERROR | IS_SUSPENDED | INFO | +---------------------+----------------------------+----------------------+---------------------+----------------------------+----------------------------+--------+----------+--------------+------+ | 1748455202538454000 | 2025-05-29 02:00:02.538454 | 1748455202538454000 | 1748455202538454000 | 2025-05-29 02:04:34.171690 | 2025-05-29 02:00:02.670090 | IDLE | NO | NO | | +---------------------+----------------------------+----------------------+---------------------+----------------------------+----------------------------+--------+----------+--------------+------+ 1 row in setObserve the
statuscolumn in the query result. The following table describes some parameters.Parameter Description FROZEN_SCN The version number of the last major compaction. FROZEN_TIME The readable time type of FROZEN_SCN.GLOBAL_BROADCAST_SCN The broadcasted major compaction version. LAST_SCN The version number of the last completed major compaction. LAST_FINISH_TIME The end time of the last major compaction. START_TIME The start time of the major compaction. STATUS The major compaction status. IDLE: Not in major compaction.COMPACTING: Major compaction in progress.VERIFYING: Checking checksums.
IS_ERROR YES: Major compaction errors exist.NO: No major compaction errors.
IS_SUSPENDED YES: Major compaction is suspended.NO: Major compaction is not suspended.
INFO Displays the major compaction information. View the partition-level major compaction information of the current tenant by using the
GV$OB_TABLET_COMPACTION_HISTORYview.The
GV$OB_TABLET_COMPACTION_HISTORYview displays the detailed historical information about tablet major compactions.obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_TABLET_COMPACTION_HISTORY WHERE TABLET_ID=200001 ORDER BY START_TIME DESC LIMIT 2\GThe query result is as follows:
*************************** 1. row *************************** SVR_IP: 11.xxx.xxx.xx SVR_PORT: 13845 TENANT_ID: 1002 LS_ID: 1001 TABLET_ID: 200001 TYPE: MDS_MINOR_MERGE COMPACTION_SCN: 1748473740429469000 START_TIME: 2025-05-29 07:09:01.089327 FINISH_TIME: 2025-05-29 07:09:01.105625 TASK_ID: Y36150BA2D939-00062481AF9F5E33-0-0 OCCUPY_SIZE: 483 MACRO_BLOCK_COUNT: 1 MULTIPLEXED_MACRO_BLOCK_COUNT: 0 NEW_MICRO_COUNT_IN_NEW_MACRO: 1 MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO: 0 TOTAL_ROW_COUNT: 1 INCREMENTAL_ROW_COUNT: 1 COMPRESSION_RATIO: 1 NEW_FLUSH_DATA_RATE: 53 PROGRESSIVE_COMPACTION_ROUND: 0 PROGRESSIVE_COMPACTION_NUM: 0 PARALLEL_DEGREE: 1 PARALLEL_INFO: - PARTICIPANT_TABLE: table_cnt=2,start_scn=1,end_scn=1748473740429469000; MACRO_ID_LIST: 49070 COMMENTS: comment="block_io_us=140;cost_mb=2;time=add_time:1748473741088728|total=16.58ms;"; START_CG_ID: 0 END_CG_ID: 0 KEPT_SNAPSHOT: MERGE_LEVEL: MACRO_BLOCK_LEVEL *************************** 2. row *************************** SVR_IP: 11.xxx.xxx.xx SVR_PORT: 13846 TENANT_ID: 1002 LS_ID: 1001 TABLET_ID: 200001 TYPE: MDS_MINOR_MERGE COMPACTION_SCN: 1748473740429469001 START_TIME: 2025-05-29 07:09:01.070737 FINISH_TIME: 2025-05-29 07:09:01.086292 TASK_ID: Y36160BA2D939-000624702F8633D4-0-0 OCCUPY_SIZE: 483 MACRO_BLOCK_COUNT: 1 MULTIPLEXED_MACRO_BLOCK_COUNT: 0 NEW_MICRO_COUNT_IN_NEW_MACRO: 1 MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO: 0 TOTAL_ROW_COUNT: 1 INCREMENTAL_ROW_COUNT: 1 COMPRESSION_RATIO: 1 NEW_FLUSH_DATA_RATE: 68 PROGRESSIVE_COMPACTION_ROUND: 0 PROGRESSIVE_COMPACTION_NUM: 0 PARALLEL_DEGREE: 1 PARALLEL_INFO: - PARTICIPANT_TABLE: table_cnt=2,start_scn=1,end_scn=1748473740429469001; MACRO_ID_LIST: 48654 COMMENTS: comment="block_io_us=115;cost_mb=2;time=add_time:1748473741069694|total=15.66ms;"; START_CG_ID: 0 END_CG_ID: 0 KEPT_SNAPSHOT: MERGE_LEVEL: MACRO_BLOCK_LEVEL 2 rows in setIn the query result, the values in the
TYPEcolumn have the following meanings:MDS_TABLE_MERGE: persists the system metadata to disk in the format of an SSTable.MAJOR_MERGE: tenant-level major compaction.MEDIUM_MERGE: partition-level major compaction.MINI_MERGE: mini compaction, which converts a MemTable into a Mini SSTable.MINOR_MERGE: minor compaction, which combines multiple Mini SSTables into one or combines multiple Mini SSTables and one Minor SSTable into one Minor SSTable.META_MAJOR_MERGE: a special compaction type that combines data before a specified timestamp into one Meta Major SSTable. The data format of the Meta Major SSTable is the same as that of a Major SSTable, without multi-version data or uncommitted transaction data.
For more information about the columns in the
GV$OB_TABLET_COMPACTION_HISTORYview, see GV$OB_TABLET_COMPACTION_HISTORY.
View the tenant-level major compaction information of the current tenant by using the
DBA_OB_ZONE_MAJOR_COMPACTIONorDBA_OB_MAJOR_COMPACTIONview.The
DBA_OB_ZONE_MAJOR_COMPACTIONview displays the major compaction information of each zone in the current tenant.obclient [TEST]> SELECT * FROM SYS.DBA_OB_ZONE_MAJOR_COMPACTION;The query result is as follows:
+-------+---------------------+----------+------------------+------------------+------------+ | ZONE | BROADCAST_SCN | LAST_SCN | LAST_FINISH_TIME | START_TIME | STATUS | +-------+---------------------+----------+------------------+------------------+------------+ | zone1 | 1748487596765126000 | 1 | 0 | 1748487596921347 | COMPACTING | +-------+---------------------+----------+------------------+------------------+------------+ 1 row in setObserve the
statuscolumn in the query result. The following table describes some parameters.Parameter Description ZONE The name of the zone. BROADCAST_SCN The broadcasted major compaction version number. LAST_SCN The version number of the last major compaction. LAST_FINISH_TIME The end time of the last major compaction. START_TIME The start time of the major compaction. STATUS The major compaction status. IDLE: Not in major compaction.COMPACTING: Major compaction in progress.VERIFYING: Checking checksums.
The
DBA_OB_MAJOR_COMPACTIONview displays the global information about major compactions in the current tenant.obclient [TEST]> SELECT * FROM SYS.DBA_OB_MAJOR_COMPACTION;The query result is as follows:
+---------------------+----------------------+----------+------------------+------------------+------------+----------+--------------+------+ | FROZEN_SCN | GLOBAL_BROADCAST_SCN | LAST_SCN | LAST_FINISH_TIME | START_TIME | STATUS | IS_ERROR | IS_SUSPENDED | INFO | +---------------------+----------------------+----------+------------------+------------------+------------+----------+--------------+------+ | 1748487596765126000 | 1748487596765126000 | 1 | 0 | 1748487596900693 | COMPACTING | NO | NO | NULL | +---------------------+----------------------+----------+------------------+------------------+------------+----------+--------------+------+ 1 row in setObserve the
statuscolumn in the query result. The following table describes some parameters.Parameter Description FROZEN_SCN The version number of the last major compaction. GLOBAL_BROADCAST_SCN The broadcasted major compaction version. LAST_SCN The version number of the last completed major compaction. LAST_FINISH_TIME The end time of the last major compaction. START_TIME The start time of the major compaction. STATUS The major compaction status. IDLE: Not in major compaction.COMPACTING: Major compaction in progress.VERIFYING: Checking checksums.
IS_ERROR YES: Major compaction errors exist.NO: No major compaction errors.
IS_SUSPENDED YES: Major compaction is suspended.NO: Major compaction is not suspended.
INFO Displays the major compaction information. View the partition-level major compaction information of the current tenant by using the
GV$OB_TABLET_COMPACTION_HISTORYview.The
GV$OB_TABLET_COMPACTION_HISTORYview displays the detailed historical information about tablet major compactions.obclient [TEST]> SELECT * FROM SYS.GV$OB_TABLET_COMPACTION_HISTORY WHERE TABLET_ID=100003 AND ROWNUM<=2 ORDER BY START_TIME\GThe query result is as follows:
*************************** 1. row *************************** SVR_IP: 11.xxx.xxx.xx SVR_PORT: 13847 TENANT_ID: 1008 LS_ID: 1 TABLET_ID: 100003 TYPE: MAJOR_MERGE COMPACTION_SCN: 1747764000946746000 START_TIME: 21-MAY-25 02.03.11.804366 AM FINISH_TIME: 21-MAY-25 02.03.11.862071 AM TASK_ID: Y36170BA2D939-00062470D0887DEB-0-0 OCCUPY_SIZE: 72990 MACRO_BLOCK_COUNT: 1 MULTIPLEXED_MACRO_BLOCK_COUNT: 0 NEW_MICRO_COUNT_IN_NEW_MACRO: 5 MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO: 0 TOTAL_ROW_COUNT: 2113 INCREMENTAL_ROW_COUNT: 2113 COMPRESSION_RATIO: 1 NEW_FLUSH_DATA_RATE: 2219 PROGRESSIVE_COMPACTION_ROUND: 1 PROGRESSIVE_COMPACTION_NUM: 0 PARALLEL_DEGREE: 1 PARALLEL_INFO: - PARTICIPANT_TABLE: table_cnt=3,[MAJOR]snapshot_version=1747677607905857000;[MINI]start_scn=1747677607968325000,end_scn=1747764079924537000; MACRO_ID_LIST: 77873 COMMENTS: comment="block_io_us=426;cost_mb=2;time=add_time:1747764190757821|wait_schedule_time=1.05s|total=58.70ms;"; START_CG_ID: 0 END_CG_ID: 0 KEPT_SNAPSHOT: {type:"UNDO_RETENTION", snapshot:1747762383511031000} MERGE_LEVEL: MACRO_BLOCK_LEVEL *************************** 2. row *************************** SVR_IP: 11.xxx.xxx.xx SVR_PORT: 13847 TENANT_ID: 1008 LS_ID: 1 TABLET_ID: 100003 TYPE: MAJOR_MERGE COMPACTION_SCN: 1747850534446081000 START_TIME: 22-MAY-25 02.04.18.276412 AM FINISH_TIME: 22-MAY-25 02.04.18.326642 AM TASK_ID: Y36170BA2D939-00062470D088DCD8-0-0 OCCUPY_SIZE: 73014 MACRO_BLOCK_COUNT: 1 MULTIPLEXED_MACRO_BLOCK_COUNT: 0 NEW_MICRO_COUNT_IN_NEW_MACRO: 5 MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO: 0 TOTAL_ROW_COUNT: 2113 INCREMENTAL_ROW_COUNT: 2113 COMPRESSION_RATIO: 1 NEW_FLUSH_DATA_RATE: 2280 PROGRESSIVE_COMPACTION_ROUND: 1 PROGRESSIVE_COMPACTION_NUM: 0 PARALLEL_DEGREE: 1 PARALLEL_INFO: - PARTICIPANT_TABLE: table_cnt=4,[MAJOR]snapshot_version=1747764000946746000;[MINI]start_scn=1747764000972140000,end_scn=1747850534468650002; MACRO_ID_LIST: 89703 COMMENTS: comment="block_io_us=233;cost_mb=2;time=add_time:1747850656732787|wait_schedule_time=1.54s|total=50.81ms;"; START_CG_ID: 0 END_CG_ID: 0 KEPT_SNAPSHOT: {type:"LS_RESERVED", snapshot:1747848846684315000} MERGE_LEVEL: MACRO_BLOCK_LEVEL 2 rows in setIn the query result, the values in the
TYPEcolumn have the following meanings:MDS_TABLE_MERGE: persists the system metadata to disk in the format of an SSTable.MAJOR_MERGE: tenant-level major compaction.MEDIUM_MERGE: partition-level major compaction.MINI_MERGE: mini compaction, which converts a MemTable into a Mini SSTable.MINOR_MERGE: minor compaction, which combines multiple Mini SSTables into one or combines multiple Mini SSTables and one Minor SSTable into one Minor SSTable.META_MAJOR_MERGE: a special compaction type that combines data before a specified timestamp into one Meta Major SSTable. The data format of the Meta Major SSTable is the same as that of a Major SSTable, without multi-version data or uncommitted transaction data.
For more information about the columns in the
GV$OB_TABLET_COMPACTION_HISTORYview, see GV$OB_TABLET_COMPACTION_HISTORY.