After a minor compaction is triggered, you can view the progress and history of the minor compactions in the database.
View the progress of minor compactions
Log in to the
systenant of the cluster as therootuser.View the progress of minor compactions. Specifically, view the size of data to be compacted and the expected time of completion.
The
GV$OB_TABLET_COMPACTION_PROGRESSview displays the progress of tablet-level minor compactions and is updated only for running minor compactions. After a minor compaction is completed, it is not displayed in the view. The sample query statement is as follows:obclient> SELECT * FROM oceanbase.GV$OB_TABLET_COMPACTION_PROGRESS WHERE TYPE='MINI_MERGE'\G; *************************** 1. row *************************** SVR_IP: xx.xx.xx.xx SVR_PORT: 2401 TENANT_ID: 1002 TYPE: MINI_MERGE LS_ID: 1001 TABLET_ID: 1152921504606847235 COMPACTION_SCN: 1680514780195130031 TASK_ID: Y9610BA2DA3E-0005F7FD6E1FE0FF-0-0 STATUS: NODE_RUNNING DATA_SIZE: 31890729 UNFINISHED_DATA_SIZE: 3351030 PROGRESSIVE_COMPACTION_ROUND: 1 CREATE_TIME: 2023-04-03 17:49:17.278506 START_TIME: 2023-04-03 17:51:57.953999 ESTIMATED_FINISH_TIME: 2023-04-03 23:32:25.969930 1 row in setThe following fields are described in the query result:
TYPE: the type of the minor compaction.MDS_TABLE_MERGE: persists the system metadata to disk in the SSTable format.MAJOR_MERGE: tenant-level major compaction.MEDIUM_MERGE: partition-level major compaction.MINI_MERGE: minor compaction that transforms MemTables into a Mini SSTable.MINOR_MERGE: minor compaction that merges multiple Mini SSTables into a new Mini SSTable or a minor SSTable.META_MAJOR_MERGE: a special type of compaction that synthesizes data from the specified time point into a Meta Major SSTable. The data format of the Meta Major SSTable is the same as that of a Major SSTable, and does not contain multi-version data or uncommitted transactions.
STATUS: the status of the task. When the task is running, the value of this field isNODE_RUNNING.DATA_SIZE: the total size of data to be compacted.UNFINISHED_DATA_SIZE: the size of data that has not been compacted.ESTIMATED_FINISH_TIME: the expected time of completion.
For more information about the fields in the
GV$OB_TABLET_COMPACTION_PROGRESSview, see GV$OB_TABLET_COMPACTION_PROGRESS.If a tablet does not appear in the view or the minor compaction for a tablet has not been completed for a long time, you can check the
GV$OB_COMPACTION_DIAGNOSE_INFOview for more information.For more information about the fields in the
GV$OB_COMPACTION_DIAGNOSE_INFOview, see GV$OB_COMPACTION_DIAGNOSE_INFO.
View the history of minor compactions
Log in to the
systenant of the cluster as therootuser.View the history of minor compactions.
The
GV$OB_TABLET_COMPACTION_HISTORYview displays the history of tablet-level minor compactions. The sample query statement is as follows:obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_TABLET_COMPACTION_HISTORY WHERE TYPE='MINI_MERGE' AND TABLET_ID=200001\G *************************** 1. row *************************** SVR_IP: xx.xx.xx.xx SVR_PORT: 2882 TENANT_ID: 1002 LS_ID: 1001 TABLET_ID: 200001 TYPE: MINI_MERGE COMPACTION_SCN: 1680142515939965301 START_TIME: 2023-03-30 10:15:20.433070 FINISH_TIME: 2023-03-30 10:15:20.433444 TASK_ID: YB42AC1E87CC-0005F7EE202A5810-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: 0 PROGRESSIVE_COMPACTION_NUM: 0 PARALLEL_DEGREE: 1 PARALLEL_INFO: - PARTICIPANT_TABLE: table_cnt=1,start_scn=1,end_scn=1680142515939965301; MACRO_ID_LIST: COMMENTS: time_guard=EXECUTE=892us|(0.49)|UPDATE_TABLET=605us|(0.33)|total=1.82ms; *************************** 2. row *************************** SVR_IP: xx.xx.xx.xx SVR_PORT: 2882 TENANT_ID: 1002 LS_ID: 1001 TABLET_ID: 200001 TYPE: MINI_MERGE COMPACTION_SCN: 1680199217439878616 START_TIME: 2023-03-31 02:00:21.835832 FINISH_TIME: 2023-03-31 02:00:21.836314 TASK_ID: YB42AC1E87CC-0005F7EE202A5C53-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: 0 PROGRESSIVE_COMPACTION_NUM: 0 PARALLEL_DEGREE: 1 PARALLEL_INFO: - PARTICIPANT_TABLE: table_cnt=1,start_scn=1680142515939965301,end_scn=1680199217439878616; MACRO_ID_LIST: COMMENTS: new_medium_list:{cnt=1;1680199204727259164}|time_guard=EXECUTE=629us|(0.39)|UPDATE_TABLET=696us|(0.43)|total=1.61ms; *************************** 3. row *************************** SVR_IP: xx.xx.xx.xx SVR_PORT: 2882 TENANT_ID: 1002 LS_ID: 1001 TABLET_ID: 200001 TYPE: MINI_MERGE COMPACTION_SCN: 1680285613573143617 START_TIME: 2023-04-01 02:00:14.248500 FINISH_TIME: 2023-04-01 02:00:14.248823 TASK_ID: YB42AC1E87CC-0005F7EE202A5F84-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: 0 PROGRESSIVE_COMPACTION_NUM: 0 PARALLEL_DEGREE: 1 PARALLEL_INFO: - PARTICIPANT_TABLE: table_cnt=1,start_scn=1680199217439878616,end_scn=1680285613573143617; MACRO_ID_LIST: COMMENTS: new_medium_list:{cnt=1;1680285601108938417}|time_guard=EXECUTE=528us|(0.22)|UPDATE_TABLET=1.58ms|(0.64)|total=2.45ms; *************************** 4. row *************************** SVR_IP: xx.xx.xx.xx SVR_PORT: 2882 TENANT_ID: 1002 LS_ID: 1001 TABLET_ID: 200001 TYPE: MINI_MERGE COMPACTION_SCN: 1680372014559392064 START_TIME: 2023-04-02 02:00:16.549722 FINISH_TIME: 2023-04-02 02:00:16.550169 TASK_ID: YB42AC1E87CC-0005F7EE202A640F-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: 0 PROGRESSIVE_COMPACTION_NUM: 0 PARALLEL_DEGREE: 1 PARALLEL_INFO: - PARTICIPANT_TABLE: table_cnt=1,start_scn=1680285613573143617,end_scn=1680372014559392064; MACRO_ID_LIST: COMMENTS: new_medium_list:{cnt=1;1680372002531630824}|time_guard=EXECUTE=635us|(0.47)|UPDATE_TABLET=476us|(0.35)|total=1.35ms; *************************** 5. row *************************** SVR_IP: xx.xx.xx.xx SVR_PORT: 2882 TENANT_ID: 1002 LS_ID: 1001 TABLET_ID: 200001 TYPE: MINI_MERGE COMPACTION_SCN: 1680458416863471713 START_TIME: 2023-04-03 02:00:18.737260 FINISH_TIME: 2023-04-03 02:00:18.737475 TASK_ID: YB42AC1E87CC-0005F7EE202A6851-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: 0 PROGRESSIVE_COMPACTION_NUM: 0 PARALLEL_DEGREE: 1 PARALLEL_INFO: - PARTICIPANT_TABLE: table_cnt=1,start_scn=1680372014559392064,end_scn=1680458416863471713; MACRO_ID_LIST: COMMENTS: new_medium_list:{cnt=1;1680458404011443372}|time_guard=EXECUTE=334us|(0.46)|CREATE_SSTABLE=125us|(0.17)|UPDATE_TABLET=173us|(0.24)|total=733us; 5 rows in setFor more information about the fields in the
GV$OB_TABLET_COMPACTION_HISTORYview, see GV$OB_TABLET_COMPACTION_HISTORY.