Note
This view is introduced in V4.0.0.
Purpose
The V$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 port number of the server. |
| 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 records 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 data volume. |
| 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 new macroblock. |
| MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO | NUMBER(38) | NO | The number of reused microblocks in a new 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 the new data: the size of the new data after compression divided by the size of the new data before compression. |
| PROGRESSIVE_COMPACTION_ROUND | NUMBER(38) | NO | The progressive compaction round. If the compaction is a full compaction, this field records -1. |
| PROGRESSIVE_COMPACTION_NUM | NUMBER(38) | NO | The total number of progressive compaction rounds. |
| PARALLEL_DEGREE | NUMBER(38) | NO | The degree of parallelism. |
| PARALLEL_INFO | VARCHAR2(512) | NO | The information about parallel tasks, including the minimum, maximum, and average values of the data scanned, runtime, and data output. |
| MACRO_ID_LIST | varchar2(256) | NO | The output macroblock list. The list is not displayed if it is too long. |
| COMMENTS | varchar2(256) | NO | Records the history of failed compactions and collects the time consumption of the current 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 multi-version snapshots retained in this compaction.
NoteThis field is introduced in V4.3.0. |
| MERGE_LEVEL | VARCHAR2(64) | NO | Indicates whether major compaction and microblock reuse are used in this compaction.
NoteThis field is introduced in V4.3.0. |
| EXEC_MODE | VARCHAR2(64) | NO | The mode of this compaction trace. Valid values:
NoteThis field is introduced in V4.3.3. |
| IS_FULL_MERGE | VARCHAR2(5) | NO | Indicates whether this 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 the 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 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 is introduced in V4.3.5 BP3. |
Sample query
The following example shows how to view the historical information about tablet-level compactions on this OBServer node.
obclient [SYS]> SELECT * FROM SYS.V$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