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
    DocsBlogLive 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 of direct load

    Last Updated:2026-04-02 06:23:56  Updated
    Share
    What is on this page
    Technical architecture
    Core mechanisms of direct load
    Storage layer architecture and direct load process
    Storage layer hierarchy
    Direct load modes
    Comparison between full load and incremental load
    Scenarios
    References

    folded

    Share

    OceanBase Database supports inserting data using the direct load method, which allows you to write data directly to data files. Direct load bypasses the SQL layer, directly allocates space, and inserts data into the data files, thereby improving data import efficiency.

    Traditional data import methods in OceanBase Database, such as LOAD DATA, OBLOADER, and OMS, rely on INSERT statements and follow this process:

    • SQL parsing -> transaction processing -> writing to MemTable -> minor compaction and major compaction -> SSTable.

    • Bottlenecks:

      • High consumption of CPU and memory resources.
      • Performance degradation when importing large volumes of data.

    With direct load technology, OceanBase Database skips these intermediate steps and writes data directly to SSTables. This reduces resource consumption (CPU and memory) and enables efficient full or incremental data import.

    Notice

    Upgrading OceanBase Database during a direct load task is not recommended, as it may cause the task to fail.

    Technical architecture

    • Traditional import path:

      Client -> SQL parsing -> transaction processing -> MemTable -> minor/major compaction -> SSTable

      Disadvantages: The path is long, resource consumption is high, and write speed is limited.

    • Direct load path:

      Client -> type conversion -> primary key sorting (optional) -> direct write to major SSTable (full import) or mini SSTable (incremental import)

      Advantages:

      • Skips intermediate modules such as SQL parsing, transaction processing, and MemTable, reducing resource consumption.
      • Directly writes data to underlying storage, avoiding the overhead of multiple compactions.

    Core mechanisms of direct load

    • Skipping intermediate layers: Bypasses SQL parsing, transaction processing, and MemTable, writing directly to SSTables.

    • Type conversion and sorting:

      • Data type conversion (for example, converting CSV data to OceanBase table structure).
      • Primary key sorting (required for full import to ensure the order of the major SSTable).

    Storage layer architecture and direct load process

    Storage layer hierarchy

    The LSM-Tree-based storage layer of OceanBase Database consists of three tiers:

    1. MemTable: An in-memory row-based structure that supports high-concurrency writes.
    2. Mini SSTable: An on-disk row-based structure generated by flushing data from the MemTable.
    3. Major SSTable: A column-based structure produced by daily major compactions, delivering optimal query performance.

    Direct load modes

    OceanBase Database supports full direct load and incremental direct load.

    When you use the LOAD DATA, INSERT INTO SELECT, or CREATE TABLE AS SELECT statement to import data, you can specify direct load for the import task by adding a hint to the statement, or by setting the global parameter default_load_mode.

    • Full direct load

      • Full direct load enables you to write an entire dataset directly into a database data file in a single operation. This method bypasses the SQL layer, directly allocates space, and inserts data into the data file, thereby improving data import efficiency.
      • Full direct load is typically used for database initialization, data migration, or quick loading of large amounts of data.
    • Incremental direct load

      • Incremental direct load allows you to write new data directly into a database data file, without using SQL interfaces, even when the database already contains a large amount of data. This method bypasses SQL layer processing and writes new data directly to the data file, thus improving data write efficiency.
      • Incremental direct load is typically used in high-throughput data write scenarios, such as large-scale real-time data collection and log write.

    Comparison between full load and incremental load

    Dimension
    Full load
    Incremental load
    Triggering scenarios Data initialization or complete data replacement Data appending or partial updates
    Import process
    1. Data is converted and sorted by primary key (if the table has a primary key).
    2. Directly written to the major SSTable (columnar format).
    3. Does not reuse existing macroblocks; processes data row by row to avoid conflicts with existing data.
    1. Data is written to the mini SSTable (row-based format).
    2. Depends on daily major compaction to convert the mini SSTable into a columnar major SSTable.
    Write location Major SSTable (columnar) Mini SSTable (row-based)
    Performance characteristics Data is processed row by row and rewritten to the major SSTable, with overhead increasing as data volume grows. Speed decreases due to data rewriting.
    • Performance decreases linearly with data volume (requires full data rewrite).
    • Table-level lock: The table is locked during import to prevent interference from other operations.
    Query performance is poor but parallel import is supported. Queries require waiting for daily major compaction to convert the mini SSTable to columnar format.
    • Poor query performance (row-based structure of the mini SSTable).
    • Partition-level lock: Only the target partition is locked, supporting parallel import.
    Lock mechanism Table lock (entire table unavailable) Partition lock (only the target partition is locked)
    Query performance Columnar tables use a columnar structure, and row-based tables use a row-based structure, offering better query performance. Both columnar and row-based tables use a row-based structure, resulting in poor query performance.

    Scenarios

    The direct load feature can be used in the following scenarios:

    • Data migration and synchronization. When migrating and synchronizing data, you often need to move large volumes of data in various formats from different data sources to OceanBase Database. The performance of traditional SQL interfaces may not meet timeliness requirements.

    • Traditional ETL. After data is extracted and transformed at the source, large amounts of data often need to be loaded into the destination within a short period. Direct load technology can improve data import performance. During the data loading phase of ETL processes, you can also use direct load to enhance efficiency.

    • Load data from text files or other data sources to OceanBase Database. The direct load technology can also improve the data loading efficiency.

    References

    • Full direct load
    • Incremental direct load

    Previous topic

    Overview
    Last

    Next topic

    Full direct load
    Next
    What is on this page
    Technical architecture
    Core mechanisms of direct load
    Storage layer architecture and direct load process
    Storage layer hierarchy
    Direct load modes
    Comparison between full load and incremental load
    Scenarios
    References