OceanBase logo

OceanBase

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

Product Overview
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

OceanBase

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

Product Overview
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.4.2

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogWhite PaperLive DemosTraining & CertificationTicket
    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.4.2
    iconOceanBase Database
    SQL - V 4.4.2
    Databases
    • OceanBase Database
    • OceanBase Cloud
    • OceanBase Tugraph
    • Interactive Tutorials
    • OceanBase Best Practices
    Tools
    • OceanBase Cloud Platform
    • OceanBase Migration Service
    • OceanBase Developer Center
    • OceanBase Migration Assessment
    • OceanBase Admin Tool
    • OceanBase Loader and Dumper
    • OceanBase Deployer
    • Kubernetes operator for OceanBase
    • OceanBase Diagnostic Tool
    • OceanBase Binlog Service
    Connectors and Middleware
    • OceanBase Database Proxy
    • Embedded SQL in C for OceanBase
    • OceanBase Call Interface
    • OceanBase Connector/C
    • OceanBase Connector/J
    • OceanBase Connector/ODBC
    • OceanBase Connector/NET
    SQL
    KV
    • V 4.6.0
    • 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

    Overview

    Last Updated:2026-06-23 02:59:12  Updated
    Share
    What is on this page
    Classification of major compactions
    Major compaction status
    Compression algorithms for major compactions
    Triggering methods
    References

    folded

    Share

    This topic describes the classification, status, and compression algorithms of major compactions.

    A major compaction compacts all dynamic and static data, which is a time-consuming operation. When the incremental data generated by minor compactions reaches the specified threshold, OceanBase Database performs a major compaction on data of the same major version. The main difference between a minor compaction and a major compaction is that a major compaction compacts data in a tenant with its static data at a unified snapshot point and finally generates a tenant-level snapshot.

    Classification of major compactions

    Major compactions can be classified into the following types based on the data volume:

    • Full compaction: All the static data is read and compacted with the dynamic data to generate the final static data. A full compaction takes a long time and consumes a large amount of I/O and CPU resources.

    • Incremental compaction: Only macroblocks modified after the last compaction are compacted. Macroblocks with no changes are reused.

      This mode greatly reduces the compaction workload. Therefore, it is the default compaction mode in OceanBase Database.

    • Progressive compaction: A part of the full data is compacted each time, and the full data can be overwritten after several progressive compactions.

    For more information about major compactions, see Major compactions.

    For more information about the parameters for major compactions, see Modify major compaction settings.

    Major compaction status

    You can obtain the major compaction status from the status column of the DBA_OB_ZONE_MAJOR_COMPACTION view.

    The major compaction status can be one of the following:

    • IDLE: No major compaction is in progress.

    • COMPACTING: A major compaction is in progress.

    • VERIFYING: The checksum is being verified.

    Compression algorithms for major compactions

    OceanBase Database does not flush a small portion of the data to the disk in real time. Instead, the data is flushed to the disk in a centralized manner through major compactions. Therefore, data can be compressed before being written to the disk to improve disk space utilization. The data compression ratio and CPU consumption level vary based on the compression algorithm and method. You can choose the algorithm and method based on your business needs.

    You can specify the default_compress_func parameter to set the compression algorithm. The default value is zstd_1.3.8. Other values supported are none, lz4_1.0, snappy_1.0, and zstd_1.0.

    Note

    A higher compression ratio saves more disk space but undermines the performance. For example, ZSTD consumes less disk space than LZ4 but takes a longer time and has a longer response time for an I/O query.

    OceanBase Database allows you to specify a compression algorithm when you create a data table.

    For more information about the syntaxes for creating a table and specifying a compression algorithm, see CREATE TABLE (MySQL-compatible mode) and CREATE TABLE (Oracle-compatible mode).

    Triggering methods

    OceanBase Database supports automatic, scheduled, adaptive, and manual major compactions.

    References

    Major compactions

    Previous topic

    Modify minor compaction parameters
    Last

    Next topic

    Automatically trigger a major compaction
    Next
    What is on this page
    Classification of major compactions
    Major compaction status
    Compression algorithms for major compactions
    Triggering methods
    References