Note
This view is available starting from V4.0.0.
Purpose
The GV$OB_TABLET_COMPACTION_HISTORY view displays the historical information about tablet-level compactions.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| SVR_IP | VARCHAR2(46) | NO | The IP address of the server. |
| SVR_PORT | NUMBER(38) | NO | The server port. |
| TENANT_ID | NUMBER(38) | NO | The tenant ID. |
| LS_ID | NUMBER(38) | NO | The log stream ID. |
| TABLET_ID | NUMBER(38) | NO | The data tablet ID. |
| TYPE | VARCHAR2(64) | NO | The type of compaction. Valid values:
|
| COMPACTION_SCN | NUMBER(38) | NO | The version of the compaction. For minor compactions, this field indicates the 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 size of data. |
| 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 output rows. |
| COMPRESSION_RATIO | NUMBER(38) | NO | The compression ratio of new data: the size of compressed data in newly generated macroblocks divided by the size of uncompressed data. |
| PROGRESSIVE_COMPACTION_ROUND | NUMBER(38) | NO | The current round of progressive compaction. If the compaction is a full compaction, this field is -1. |
| PROGRESSIVE_COMPACTION_NUM | NUMBER(38) | NO | The total number of rounds of progressive compaction. |
| PARALLEL_DEGREE | NUMBER(38) | NO | The degree of parallelism. |
| PARALLEL_INFO | VARCHAR2(512) | NO | The information about the parallel task, including the minimum, maximum, and average values of the statistics on the amount of data scanned, the running time, and the amount of data output. |
| MACRO_ID_LIST | varchar2(256) | NO | The list of output macroblocks. The macroblock list is not displayed if it is too long. |
| COMMENTS | varchar2(256) | NO | Records the history of failed compactions and collects information about the time spent on this compaction. |
| START_CG_ID | NUMBER(38) | NO | The start ID of the column group.
NoteThis field is introduced in V4.3.0. |
| END_CG_ID | NUMBER(38) | NO | The end ID of the column group.
NoteThis field is introduced in V4.3.0. |
| KEPT_SNAPSHOT | VARCHAR2(128) | NO | The information about the multi-version snapshots retained in this compaction.
NoteThis field is introduced in V4.3.0. |
| MERGE_LEVEL | VARCHAR2(64) | NO | Whether to perform major compaction or reuse microblocks in this compaction.
NoteThis field is introduced in V4.3.0. |
| EXEC_MODE | VARCHAR2(64) | NO | The mode of the compaction trace. Valid values:
NoteThis field is introduced in V4.3.3. |
| IS_FULL_MERGE | VARCHAR2(5) | NO | Whether the compaction is a full compaction.
NoteThis field is introduced in V4.3.3. |
| IO_COST_TIME_PERCENTAGE | NUMBER(38) | NO | The percentage of I/O time in the total compaction time.
NoteThis field is introduced in V4.3.3. |
| MERGE_REASON | VARCHAR2(32) | NO | The reason for initiating the compaction. Valid values:
NoteThis field is introduced in V4.3.3. |
| BASE_MAJOR_STATUS | VARCHAR2(64) | NO | The type of Major SSTable before the compaction. Valid values:
NoteThis field is introduced in V4.3.3. |
| CO_MERGE_TYPE | VARCHAR2(64) | NO | The type of columnar store table after the compaction. Valid values:
NoteThis field is introduced in V4.3.3. |
| MDS_FILTER_INFO | VARCHAR2(1024) | NO | This view displays the MDS filter information used for major compaction.
NoteThis field was introduced in V4.3.5 and takes effect starting from V4.3.5 BP2. |
| EXECUTE_TIME | NUMBER(38) | NO | The time consumed by the major compaction task for CPU, in milliseconds.
NoteThis field was introduced in V4.3.5 BP3. |
Sample query
Tenant A queries the historical information about tablet-level compactions on all OBServer nodes.
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.xxx.xxx
SVR_PORT: 2882
TENANT_ID: 1004
LS_ID: 1
TABLET_ID: 60379
TYPE: MAJOR_MERGE
COMPACTION_SCN: 1750701602970025000
START_TIME: 24-JUN-25 02.03.53.830276 AM
FINISH_TIME: 24-JUN-25 02.03.53.840954 AM
TASK_ID: YB42AC1E87D9-00063837DFD7BB62-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: NULL
START_CG_ID: 0
END_CG_ID: 0
KEPT_SNAPSHOT: {type:"UNDO_RETENTION", snapshot:1750700023151746000}
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: NULL
CO_MERGE_TYPE: NULL
MDS_FILTER_INFO: NULL
EXECUTE_TIME: 684
1 row in set