Note
This view was introduced in OceanBase Database V4.0.0.
Purpose
The GV$OB_TABLET_COMPACTION_HISTORY view displays the tablet-level compaction history.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| SVR_IP | VARCHAR2(46) | NO | The IP address of the OBServer node. |
| SVR_PORT | NUMBER(38) | NO | The port number of the OBServer node. |
| TENANT_ID | NUMBER(38) | NO | The ID of the tenant. |
| LS_ID | NUMBER(38) | NO | The ID of the log stream. |
| TABLET_ID | NUMBER(38) | NO | The ID of the tablet. |
| TYPE | VARCHAR2(64) | NO | The compaction type. Valid values:
|
| COMPACTION_SCN | NUMBER(38) | NO | The compaction version. The minor version is a snapshot version. |
| START_TIME | TIMESTAMP(6) WITH LOCAL TIME ZONE | NO | The start time. |
| FINISH_TIME | TIMESTAMP(6) WITH LOCAL TIME ZONE | NO | The end time. |
| OCCUPY_SIZE | NUMBER(38) | NO | The data amount. |
| MACRO_BLOCK_COUNT | NUMBER(38) | NO | The number of macroblocks. |
| MULTIPLEXED_MACRO_BLOCK_COUNT | NUMBER(38) | NO | The number of reused macroblocks. |
| NEW_MICRO_COUNT_IN_NEW_MACRO | NUMBER(38) | NO | The number of new microblocks in a newly generated macroblock. |
| MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO | NUMBER(38) | NO | The number of reused microblocks in a newly generated macroblock. |
| TOTAL_ROW_COUNT | NUMBER(38) | NO | The total number of rows. |
| INCREMENTAL_ROW_COUNT | NUMBER(38) | NO | The number of new rows. |
| COMPRESSION_RATIO | NUMBER(38) | NO | The compression ratio of new data, which is the ratio of the size of compressed new macroblock data to the data size before compression. |
| PROGRESSIVE_COMPACTION_ROUND | NUMBER(38) | NO | The current compaction round during a progressive compaction. For a full compaction, the value is -1. |
| PROGRESSIVE_COMPACTION_NUM | NUMBER(38) | NO | The total number of compaction rounds in a progressive compaction. |
| PARALLEL_DEGREE | NUMBER(38) | NO | The degree of parallelism (DOP). |
| PARALLEL_INFO | VARCHAR2(512) | NO | The parallel task information, including statistics (MIN/MAX/AVG) on the scanned data amount, operating time, and output data amount of the parallel task. |
| MACRO_ID_LIST | varchar2(256) | NO | The list of output macroblocks. If the macroblock list is too long, it is not displayed. |
| COMMENTS | varchar2(256) | NO | The history of failed compactions and the collection duration of the current compaction. |
| START_CG_ID | bigint(20) | NO | The ID of the first column in the column group.
NoteThis column is available in OceanBase Database V4.3.0 and later. |
| END_CG_ID | bigint(20) | NO | The ID of the last column in the column group.
NoteThis column is available in OceanBase Database V4.3.0 and later. |
| KEPT_SNAPSHOT | varchar(128) | NO | The multi-version snapshot for the compaction.
NoteThis column is available in OceanBase Database V4.3.0 and later. |
| MERGE_LEVEL | varchar(64) | NO | Indicates whether a major compaction was performed or microblocks were reused.
NoteThis column is available in OceanBase Database V4.3.0 and later. |
Sample query
Query the tablet-level compaction history on all OBServer nodes from a user tenant.
obclient [SYS]> SELECT * FROM SYS.GV$OB_TABLET_COMPACTION_HISTORY WHERE ROWNUM = 1\G
The query result is as follows:
*************************** 1. row ***************************
SVR_IP: 172.xx.xx.xx
SVR_PORT: 2882
TENANT_ID: 1004
LS_ID: 1
TABLET_ID: 60379
TYPE: MAJOR_MERGE
COMPACTION_SCN: 1722880804392106676
START_TIME: 06-AUG-24 02.00.49.532794 AM
FINISH_TIME: 06-AUG-24 02.00.49.540051 AM
TASK_ID: YB4XXXXXXXXX-000XXXXXXXXXXXXX-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=1;
MACRO_ID_LIST: NULL
COMMENTS: comment="merge_reason="TENANT_MAJOR";time=add_time:1722880849532694|total=7.26ms;";
START_CG_ID: 0
END_CG_ID: 0
1 row in set