After initiating a major compaction, you can view the compaction information through views.
The process of a major compaction can be viewed through views. Generally, the duration of a major compaction depends on the amount of data changed between two major compactions. A larger amount of data change between two major compactions results in a longer compaction time. Additionally, factors such as the number of threads used for the compaction and the cluster load during the compaction also affect the duration.
View major compaction information of all tenants in the system tenant
You can query views in the system tenant to view the tenant-level and partition-level major compaction information of all tenants.
Log in to the
systenant of the cluster as therootuser.Execute the following statements to view the major compaction information:
Query the
CDB_OB_ZONE_MAJOR_COMPACTIONorCDB_OB_MAJOR_COMPACTIONview for tenant-level major compaction information.The
CDB_OB_ZONE_MAJOR_COMPACTIONview displays the major compaction process of each zone in all tenants.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 setIn the execution result, observe the
statuscolumn. The meanings of some columns are described in the following table.ColumnDescriptionTENANT_ID The tenant ID. ZONE The name of the zone. BROADCAST_SCN The broadcast version number of the major compaction. 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: No major compaction is in progress.COMPACTING: A major compaction is in progress.VERIFYING: The checksum is being verified.
The
CDB_OB_MAJOR_COMPACTIONview displays 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 setIn the execution result, observe the
statuscolumn. The meanings of some columns are described in the following table.ColumnDescriptionTENANT_ID The tenant ID. FROZEN_SCN The version number of the most recent major compaction. FROZEN_TIME The readable time type of FROZEN_SCN.GLOBAL_BROADCAST_SCN The globally broadcast version number of the major compaction. LAST_SCN The version 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: No major compaction is in progress.COMPACTING: A major compaction is in progress.VERIFYING: The checksum is being verified.
IS_ERROR YES: An error occurred during the major compaction.NO: No error occurred during the major compaction.
IS_SUSPENDED YES: The major compaction is suspended.NO: The major compaction is not suspended.
INFO Displays information about the major compaction. Query the
GV$OB_MERGE_INFOorGV$OB_TABLET_COMPACTION_HISTORYview for partition-level major compaction information.The
GV$OB_MERGE_INFOview displays basic statistics for tablet-level 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 setIn the query result, the meanings of the values in the
ACTIONcolumn are as follows:MDS_TABLE_MERGE: Persists system metadata to disk in SSTable format.MAJOR_MERGE: Tenant-level major compaction.MEDIUM_MERGE: Partition-level major compaction.MINI_MERGE: Mini compaction, converting the MemTable into a Mini SSTable.MINOR_MERGE: Minor compaction, combining multiple Mini SSTables into a new Mini SSTable, or combining multiple Mini SSTables with one Minor SSTable into a new Minor SSTable.META_MAJOR_MERGE: A special type of compaction that combines data from before a specified point in time into a Meta Major SSTable. Its data format is the same as that of a Major SSTable, excluding multi-version data and uncommitted transaction data.
For more details about the fields in the
GV$OB_MERGE_INFOview, see GV$OB_MERGE_INFO.The
GV$OB_TABLET_COMPACTION_HISTORYview displays detailed historical information about tablet-level 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 2\GThe query result is as follows:
*************************** 1. row *************************** SVR_IP: 172.xx.xxx.xxx SVR_PORT: 2882 TENANT_ID: 1002 LS_ID: 1001 TABLET_ID: 200001 TYPE: MAJOR_MERGE COMPACTION_SCN: 1748455203748142000 START_TIME: 2025-05-29 02:03:35.771081 FINISH_TIME: 2025-05-29 02:03:35.778086 TASK_ID: YB42AC1E87E0-000635386FA342D5-0-0 OCCUPY_SIZE: 0 MACRO_BLOCK_COUNT: 0 MULTIPLEXED_MACRO_BLOCK_COUNT: 0 NEW_MICRO_COUNT_IN_NEW_MACRO: 0 MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO: 0 TOTAL_ROW_COUNT: 0 INCREMENTAL_ROW_COUNT: 0 COMPRESSION_RATIO: 1 NEW_FLUSH_DATA_RATE: 0 PROGRESSIVE_COMPACTION_ROUND: 1 PROGRESSIVE_COMPACTION_NUM: 0 PARALLEL_DEGREE: 1 PARALLEL_INFO: - PARTICIPANT_TABLE: table_cnt=1,[MAJOR]snapshot_version=1748368801840485000; MACRO_ID_LIST: COMMENTS: START_CG_ID: 0 END_CG_ID: 0 KEPT_SNAPSHOT: {type:"UNDO_RETENTION", snapshot:1748453603923723000} MERGE_LEVEL: MICRO_BLOCK_LEVEL EXEC_MODE: EXEC_MODE_LOCAL IS_FULL_MERGE: FALSE IO_COST_TIME_PERCENTAGE: 0 MERGE_REASON: TENANT_MAJOR BASE_MAJOR_STATUS: CO_MERGE_TYPE: MDS_FILTER_INFO: *************************** 2. row *************************** SVR_IP: 172.xx.xxx.xxx SVR_PORT: 2882 TENANT_ID: 1002 LS_ID: 1001 TABLET_ID: 200001 TYPE: MDS_MINOR_MERGE COMPACTION_SCN: 1748398151630809003 START_TIME: 2025-05-28 10:09:12.139170 FINISH_TIME: 2025-05-28 10:09:12.145988 TASK_ID: YB42AC1E87E0-000635386FA3413D-0-0 OCCUPY_SIZE: 493 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: 78 PROGRESSIVE_COMPACTION_ROUND: 0 PROGRESSIVE_COMPACTION_NUM: 0 PARALLEL_DEGREE: 1 PARALLEL_INFO: - PARTICIPANT_TABLE: table_cnt=2,start_scn=1,end_scn=1748398151630809003; MACRO_ID_LIST: 77871 COMMENTS: comment="cost_mb=2;"; START_CG_ID: 0 END_CG_ID: 0 KEPT_SNAPSHOT: MERGE_LEVEL: MACRO_BLOCK_LEVEL EXEC_MODE: EXEC_MODE_LOCAL IS_FULL_MERGE: FALSE IO_COST_TIME_PERCENTAGE: 3 MERGE_REASON: BASE_MAJOR_STATUS: CO_MERGE_TYPE: MDS_FILTER_INFO: 2 rows in setIn the query result, the meanings of the values in the
TYPEcolumn are as follows:MDS_TABLE_MERGE: Persists system metadata to disk in SSTable format.MAJOR_MERGE: Tenant-level major compaction.MEDIUM_MERGE: Partition-level major compaction.MINI_MERGE: Mini compaction, converting the MemTable into a Mini SSTable.MINOR_MERGE: Minor compaction, combining multiple Mini SSTables into a new Mini SSTable, or combining multiple Mini SSTables with one Minor SSTable into a new Minor SSTable.META_MAJOR_MERGE: A special type of compaction that combines data from before a specified point in time into a Meta Major SSTable. Its data format is the same as that of a Major SSTable, excluding multi-version data and uncommitted transaction data.
For more details about the fields in the
GV$OB_TABLET_COMPACTION_HISTORYview, see GV$OB_TABLET_COMPACTION_HISTORY.
View major compaction information of a user tenant
You can also view the major compaction information of a user tenant through views.
Log in to the database as the tenant administrator of the user tenant.
Execute the following statements to view the major compaction information.
MySQL modeOracle-compatible modeView the tenant-level major compaction information of the current tenant through the
DBA_OB_ZONE_MAJOR_COMPACTIONorDBA_OB_MAJOR_COMPACTIONview.The
DBA_OB_ZONE_MAJOR_COMPACTIONview displays the major compaction information for each zone in the current tenant.obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_ZONE_MAJOR_COMPACTION;An example of the query result is as follows:
+-------+---------------------+---------------------+----------------------------+----------------------------+--------+ | 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 setIn the execution result, observe the
statuscolumn. The descriptions for some parameters are shown in the following table.ColumnDescriptionZONE The name of the zone. BROADCAST_SCN The broadcast version number of the major compaction. 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: No major compaction is in progress.COMPACTING: A major compaction is in progress.VERIFYING: The checksum is being verified.
The
DBA_OB_MAJOR_COMPACTIONview displays the global major compaction information of 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 setIn the execution result, observe the
statuscolumn. The descriptions for some parameters are shown in the following table.ColumnDescriptionFROZEN_SCN The version number of the most recent major compaction. FROZEN_TIME The readable time type of FROZEN_SCN.GLOBAL_BROADCAST_SCN The globally broadcast version number of the major compaction. LAST_SCN The version 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: No major compaction is in progress.COMPACTING: A major compaction is in progress.VERIFYING: The checksum is being verified.
IS_ERROR YES: An error occurred during the major compaction.NO: No errors were reported during the major compaction.
IS_SUSPENDED YES: The major compaction is suspended.NO: The major compaction is not suspended.
INFO Displays information about the major compaction. Query the
GV$OB_TABLET_COMPACTION_HISTORYview for partition-level major compaction information of the current tenant.The
GV$OB_TABLET_COMPACTION_HISTORYview displays detailed historical information about tablet-level 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: 172.xx.xxx.xxx SVR_PORT: 2882 TENANT_ID: 1002 LS_ID: 1001 TABLET_ID: 200001 TYPE: MAJOR_MERGE COMPACTION_SCN: 1748455203748142000 START_TIME: 2025-05-29 02:03:35.771081 FINISH_TIME: 2025-05-29 02:03:35.778086 TASK_ID: YB42AC1E87E0-000635386FA342D5-0-0 OCCUPY_SIZE: 0 MACRO_BLOCK_COUNT: 0 MULTIPLEXED_MACRO_BLOCK_COUNT: 0 NEW_MICRO_COUNT_IN_NEW_MACRO: 0 MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO: 0 TOTAL_ROW_COUNT: 0 INCREMENTAL_ROW_COUNT: 0 COMPRESSION_RATIO: 1 NEW_FLUSH_DATA_RATE: 0 PROGRESSIVE_COMPACTION_ROUND: 1 PROGRESSIVE_COMPACTION_NUM: 0 PARALLEL_DEGREE: 1 PARALLEL_INFO: - PARTICIPANT_TABLE: table_cnt=1,[MAJOR]snapshot_version=1748368801840485000; MACRO_ID_LIST: COMMENTS: START_CG_ID: 0 END_CG_ID: 0 KEPT_SNAPSHOT: {type:"UNDO_RETENTION", snapshot:1748453603923723000} MERGE_LEVEL: MICRO_BLOCK_LEVEL EXEC_MODE: EXEC_MODE_LOCAL IS_FULL_MERGE: FALSE IO_COST_TIME_PERCENTAGE: 0 MERGE_REASON: TENANT_MAJOR BASE_MAJOR_STATUS: CO_MERGE_TYPE: MDS_FILTER_INFO: *************************** 2. row *************************** SVR_IP: 172.xx.xxx.xxx SVR_PORT: 2882 TENANT_ID: 1002 LS_ID: 1001 TABLET_ID: 200001 TYPE: MDS_MINOR_MERGE COMPACTION_SCN: 1748398151630809003 START_TIME: 2025-05-28 10:09:12.139170 FINISH_TIME: 2025-05-28 10:09:12.145988 TASK_ID: YB42AC1E87E0-000635386FA3413D-0-0 OCCUPY_SIZE: 493 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: 78 PROGRESSIVE_COMPACTION_ROUND: 0 PROGRESSIVE_COMPACTION_NUM: 0 PARALLEL_DEGREE: 1 PARALLEL_INFO: - PARTICIPANT_TABLE: table_cnt=2,start_scn=1,end_scn=1748398151630809003; MACRO_ID_LIST: 77871 COMMENTS: comment="cost_mb=2;"; START_CG_ID: 0 END_CG_ID: 0 KEPT_SNAPSHOT: MERGE_LEVEL: MACRO_BLOCK_LEVEL EXEC_MODE: EXEC_MODE_LOCAL IS_FULL_MERGE: FALSE IO_COST_TIME_PERCENTAGE: 3 MERGE_REASON: BASE_MAJOR_STATUS: CO_MERGE_TYPE: MDS_FILTER_INFO: 2 rows in setIn the query result, the meanings of the values in the
TYPEcolumn are as follows:MDS_TABLE_MERGE: Persists system metadata to disk in SSTable format.MAJOR_MERGE: Tenant-level major compaction.MEDIUM_MERGE: Partition-level major compaction.MINI_MERGE: Mini compaction, converting the MemTable into a Mini SSTable.MINOR_MERGE: Minor compaction, combining multiple Mini SSTables into a new Mini SSTable, or combining multiple Mini SSTables with one Minor SSTable into a new Minor SSTable.META_MAJOR_MERGE: A special type of compaction that combines data from before a specified point in time into a Meta Major SSTable. Its data format is the same as that of a Major SSTable, excluding multi-version data and uncommitted transaction data.
For more details about the fields in the
GV$OB_TABLET_COMPACTION_HISTORYview, see GV$OB_TABLET_COMPACTION_HISTORY.
Query the
DBA_OB_ZONE_MAJOR_COMPACTIONorDBA_OB_MAJOR_COMPACTIONview for tenant-level major compaction information of the current tenant.The
DBA_OB_ZONE_MAJOR_COMPACTIONview displays the major compaction information for 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 setIn the execution result, observe the
statuscolumn. The descriptions for some parameters are shown in the following table.ColumnDescriptionZONE The name of the zone. BROADCAST_SCN The broadcast version number of the major compaction. 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: No major compaction is in progress.COMPACTING: A major compaction is in progress.VERIFYING: The checksum is being verified.
The
DBA_OB_MAJOR_COMPACTIONview displays the global major compaction information of 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 setIn the execution result, observe the
statuscolumn. The descriptions for some parameters are shown in the following table.ColumnDescriptionFROZEN_SCN The latest major compaction snapshot. GLOBAL_BROADCAST_SCN The globally broadcast version number of the major compaction. LAST_SCN The version 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: No major compaction is in progress.COMPACTING: A major compaction is in progress.VERIFYING: The checksum is being verified.
IS_ERROR YES: An error occurred during the major compaction.NO: No errors were reported during the major compaction.
IS_SUSPENDED YES: The major compaction is suspended.NO: The major compaction is not suspended.
INFO Displays information about the major compaction. Query the
GV$OB_TABLET_COMPACTION_HISTORYview for partition-level major compaction information of the current tenant.The
GV$OB_TABLET_COMPACTION_HISTORYview displays detailed historical information about tablet-level major compactions.obclient [TEST]> SELECT * FROM SYS.GV$OB_TABLET_COMPACTION_HISTORY WHERE TABLET_ID=200001 AND ROWNUM<=10 ORDER BY START_TIME\GThe query result is as follows:
*************************** 1. row *************************** SVR_IP: 172.xx.xxx.xxx SVR_PORT: 2882 TENANT_ID: 1004 LS_ID: 1001 TABLET_ID: 200001 TYPE: MDS_MINOR_MERGE COMPACTION_SCN: 1748368803414843000 START_TIME: 28-MAY-25 02.00.05.107746 AM FINISH_TIME: 28-MAY-25 02.00.05.113086 AM TASK_ID: YB42AC1E87E0-00063538753335FD-0-0 OCCUPY_SIZE: 630 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: 2 INCREMENTAL_ROW_COUNT: 2 COMPRESSION_RATIO: 1 NEW_FLUSH_DATA_RATE: 191 PROGRESSIVE_COMPACTION_ROUND: 0 PROGRESSIVE_COMPACTION_NUM: 0 PARALLEL_DEGREE: 1 PARALLEL_INFO: - PARTICIPANT_TABLE: table_cnt=2,start_scn=1,end_scn=1748368803414843000; MACRO_ID_LIST: 75689 COMMENTS: comment="cost_mb=2;"; START_CG_ID: 0 END_CG_ID: 0 KEPT_SNAPSHOT: NULL MERGE_LEVEL: MACRO_BLOCK_LEVEL EXEC_MODE: EXEC_MODE_LOCAL IS_FULL_MERGE: FALSE IO_COST_TIME_PERCENTAGE: 2 MERGE_REASON: NULL BASE_MAJOR_STATUS: NULL CO_MERGE_TYPE: NULL MDS_FILTER_INFO: NULL 1 row in setIn the query result, the meanings of the values in the
TYPEcolumn are as follows:MDS_TABLE_MERGE: Persists system metadata to disk in SSTable format.MAJOR_MERGE: Tenant-level major compaction.MEDIUM_MERGE: Partition-level major compaction.MINI_MERGE: Mini compaction, converting the MemTable into a Mini SSTable.MINOR_MERGE: Minor compaction, combining multiple Mini SSTables into a new Mini SSTable, or combining multiple Mini SSTables with one Minor SSTable into a new Minor SSTable.META_MAJOR_MERGE: A special type of compaction that combines data from before a specified point in time into a Meta Major SSTable. Its data format is the same as that of a Major SSTable, excluding multi-version data and uncommitted transaction data.
For more details about the fields in the
GV$OB_TABLET_COMPACTION_HISTORYview, see GV$OB_TABLET_COMPACTION_HISTORY.