OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.3.3

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & Certification
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.3.3
    iconOceanBase Database
    SQL - V 4.3.3
    SQL
    KV
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    V$OB_TABLET_COMPACTION_HISTORY

    Last Updated:2024-12-02 03:48:27  Updated
    share
    What is on this page
    Purpose
    Columns
    Sample query
    References

    folded

    share

    Note

    This view was introduced in OceanBase Database V4.0.0.

    Purpose

    The V$OB_TABLET_COMPACTION_HISTORY view displays the tablet-level compaction history.

    Columns

    Column Type Nullable? Description
    SVR_IP varchar(46) NO The IP address of the OBServer node.
    SVR_PORT bigint(20) NO The port number of the OBServer node.
    TENANT_ID bigint(20) NO The ID of the tenant.
    LS_ID bigint(20) NO The ID of the log stream.
    TABLET_ID bigint(20) NO The ID of the tablet.
    TYPE varchar(64) NO The compaction type. Valid values:
    • MDS_TABLE_MERGE: indicates to persist system metadata to the disk in the SSTable format.
    • MAJOR_MERGE: indicates a tenant-level major compaction.
    • MEDIUM_MERGE: indicates a partition-level major compaction.
    • MINI_MERGE: indicates a mini compaction that converts a MemTable to a mini SSTable.
    • MINOR_MERGE: indicates a minor compaction that combines multiple mini SSTables or multple mini SSTables and minor SSTables into one minor SSTable.
    • META_MAJOR_MERGE: indicates a special compaction type that compacts the data generated before a specified point in time into a meta major SSTable, which has the same data format as a major SSTable but does not contain multi-version data or data of uncommitted transactions.
    COMPACTION_SCN bigint(20) unsigned NO The major compaction version.
    START_TIME timestamp(6) NO The start time.
    FINISH_TIME timestamp(6) NO The end time.
    TASK_ID varchar(64) NO The task execution trace.
    OCCUPY_SIZE bigint(20) NO The data amount.
    MACRO_BLOCK_COUNT bigint(20) NO The number of macroblocks.
    MULTIPLEXED_MACRO_BLOCK_COUNT bigint(20) NO The number of reused macroblocks.
    NEW_MICRO_COUNT_IN_NEW_MACRO bigint(20) NO The number of new microblocks in a newly generated macroblock.
    MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO bigint(20) NO The number of reused microblocks in a newly generated macroblock.
    TOTAL_ROW_COUNT bigint(20) NO The total number of rows.
    INCREMENTAL_ROW_COUNT bigint(20) NO The number of new rows.
    COMPRESSION_RATIO double 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.
    NEW_FLUSH_DATA_RATE bigint(20) NO The output speed of new data, in KB/s.
    PROGRESSIVE_COMPACTION_ROUND bigint(20) NO The current compaction round during a progressive compaction. For a full compaction, the value is -1.
    PROGRESSIVE_COMPACTION_NUM bigint(20) NO The total number of compaction rounds in a progressive compaction.
    PARALLEL_DEGREE bigint(20) NO The degree of parallelism (DOP).
    PARALLEL_INFO varchar(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.
    PARTICIPANT_TABLE varchar(512) NO The table that participates in the compaction.
    MACRO_ID_LIST varchar(256) NO The list of output macroblocks. If the macroblock list is too long, it is not displayed.
    COMMENTS varchar(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.

    Note

    This 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.

    Note

    This column is available in OceanBase Database V4.3.0 and later.

    KEPT_SNAPSHOT varchar(128) NO The multi-version snapshot for the compaction.

    Note

    This 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.

    Note

    This column is available in OceanBase Database V4.3.0 and later.

    Sample query

    Query the tablet-level compaction history on the current OBServer node from a user tenant.

    obclient [oceanbase]> SELECT * FROM oceanbase.V$OB_TABLET_COMPACTION_HISTORY LIMIT 1\G
    

    The query result is as follows:

    *************************** 1. row ***************************
                                  SVR_IP: 172.xx.xx.xx
                                SVR_PORT: 2882
                               TENANT_ID: 1002
                                   LS_ID: 1
                               TABLET_ID: 60379
                                    TYPE: MAJOR_MERGE
                          COMPACTION_SCN: 1722880804553022418
                              START_TIME: 2024-08-06 02:00:14.374896
                             FINISH_TIME: 2024-08-06 02:00:14.381909
                                 TASK_ID: YB4XXXXXXXXX-000XXXXXXXXXXXX-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:
                                COMMENTS: comment="merge_reason="TENANT_MAJOR";time=add_time:1722880814374751|total=7.01ms;";
                             START_CG_ID: 0
                               END_CG_ID: 0
                           KEPT_SNAPSHOT: {type:" SNAPSHOT_UNDO_RETENTION", snapshot:1722879004021414960}
                             MERGE_LEVEL: MICRO_BLOCK_LEVEL
    1 row in set
    

    References

    • GV$OB_TABLET_COMPACTION_HISTORY

    • V$OB_TABLET_COMPACTION_PROGRESS

    • View minor compaction information

    • View major compaction information

    Previous topic

    V$OB_SYS_TIME_MODEL
    Last

    Next topic

    V$OB_TABLET_COMPACTION_PROGRESS
    Next
    What is on this page
    Purpose
    Columns
    Sample query
    References