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 Best Practices

All Versions

  • Deploy
    • Configuration guide for read-write splitting in AP scenarios
    • Best practices for read-write splitting
  • Migrate
    • Data transfer solutions in OceanBase Database
    • Overview on data migration
    • Best practices for importing data files to OceanBase Database
    • Best practice for migrating data from other databases to OceanBase Database
    • Massive data migration strategy
    • Best practices for migrating data from MyCat to OceanBase Database
    • Best practices for migrating PostgreSQL to OceanBase MySQL-compatible mode
  • Route
    • ODP routing best practices
  • Table Design
    • Best practices for table design and index optimization
    • Best practices for creating indexes on large tables
    • Best practices for database development
  • Develop
    • Best practices for connecting Java applications to OceanBase Database
    • Best practices for integrating Spark Catalog with OceanBase Database
    • Best practices for achieving optimal performance in batch DML using JDBC and OBServer
    • Best practices for bulk data cleanup in OceanBase Database
    • Best practices for PDML processing in OceanBase Database
    • Best practices for hot tables in OceanBase Database
    • Best practices for auto-increment columns and sequences in OceanBase Database
  • Manage
    • Best practices for resource throttling
    • Best practices for data load balancing
    • Best practices for security certification
    • Best practices for access control
    • Best practices for data encryption
  • Diagnose
    • Best practices for log interpretation in common scenarios
    • Best practices for end-to-end tracing
    • Best practices for using obdiag to collect performance information
    • Best practices for using obdiag to collect diagnostic information of parallel and slow SQL statements
    • Best practices for troubleshooting OceanBase Database performance issues
  • Performance Tuning
    • Best practices for handling slow queries
    • Best practices for collecting statistics to generate an efficient execution plan
    • Best practices for updating hotspot rows
    • Best practices for large object storage performance
    • Best practices for semi-structured storage performance
    • Best practices for OceanBase materialized views
  • Cloud Database
    • Best practices for achieving high availability through cross-cloud active-active deployment
    • High availability through primary and standby databases across clouds
    • High host CPU usage
    • Best practices for read/write splitting in OceanBase Cloud

Download PDF

Configuration guide for read-write splitting in AP scenarios Best practices for read-write splitting Data transfer solutions in OceanBase Database Overview on data migration Best practices for importing data files to OceanBase Database Best practice for migrating data from other databases to OceanBase Database Massive data migration strategy Best practices for migrating data from MyCat to OceanBase Database Best practices for migrating PostgreSQL to OceanBase MySQL-compatible mode ODP routing best practices Best practices for table design and index optimization Best practices for creating indexes on large tables Best practices for database development Best practices for connecting Java applications to OceanBase Database Best practices for integrating Spark Catalog with OceanBase Database Best practices for achieving optimal performance in batch DML using JDBC and OBServer Best practices for bulk data cleanup in OceanBase Database Best practices for PDML processing in OceanBase Database Best practices for hot tables in OceanBase Database Best practices for auto-increment columns and sequences in OceanBase Database Best practices for resource throttling Best practices for data load balancing Best practices for security certification Best practices for access control Best practices for data encryption Best practices for log interpretation in common scenarios Best practices for end-to-end tracing Best practices for using obdiag to collect performance information Best practices for using obdiag to collect diagnostic information of parallel and slow SQL statements Best practices for troubleshooting OceanBase Database performance issues Best practices for handling slow queries Best practices for collecting statistics to generate an efficient execution plan Best practices for updating hotspot rows Best practices for large object storage performance Best practices for semi-structured storage performance Best practices for OceanBase materialized views Best practices for achieving high availability through cross-cloud active-active deployment High availability through primary and standby databases across clouds High host CPU usage Best practices for read/write splitting in OceanBase Cloud
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 Best Practices
  3. master
iconOceanBase Best Practices
master
  • master

Best practices for large object storage performance

Last Updated:2025-07-15 09:43:03  Updated
share
What is on this page
Background information
What is a LOB?
LOB storage modes
Performance challenges
Performance diagnostics and optimization solutions
Identify performance issues with OUTROW storage
Optimization solutions
Example
Test environment
Symptom
Optimization solutions

folded

share

This topic describes how to improve the performance of OceanBase Database by optimizing the storage of large objects (LOBs).

Background information

What is a LOB?

A LOB is a type of ultra-large text or binary data stored in a database, such as text files, images, or audio files. LOBs are commonly used to store unstructured data and provide a comprehensive data storage solution for database applications.

LOB storage modes

OceanBase Database supports two LOB storage modes:

  • INROW storage: Data is stored directly within the data rows.
    • Advantages: Provides excellent read performance with no additional I/O overhead.
    • Disadvantages: Consumes primary table space and may reduce the access efficiency of other columns.
  • OUTROW storage: Data is stored in a separate object storage.
    • Advantages: Conserves primary table space and is ideal for storing extremely large objects.
    • Disadvantages: Requires additional I/O operations, resulting in lower read performance.

Performance challenges

In production environments, LOBs and JSON data stored in OUTROW mode may encounter the following challenges:

  • Lower read performance: Accessing data stored in OUTROW mode requires additional I/O operations, which can degrade performance.
  • Challenges with JSON data types:
    • Parsing JSON structures incurs higher overhead.
    • Performance is negatively impacted in scenarios with frequent read and write operations.

Notice

The high overhead issues related to handling LOB and JSON columns have been resolved in OceanBase Database V4.2.2, V4.3.1, and later versions. For more information, see the "Upgrade OceanBase Database to a proper version" section in this topic.

Performance diagnostics and optimization solutions

Identify performance issues with OUTROW storage

  • Symptoms of performance degradation:

    • Noticeable increase in query latency.
    • High proportion of time spent on I/O waits.
  • Diagnostic methods:

    • Execute the EXPLAIN statement to analyze execution plans.
    • Monitor I/O-related performance metrics.

Optimization solutions

Implement intelligent storage strategies

The primary cause of performance degradation when handling LOB columns is that the data is stored in OUTROW mode, leading to additional data access overhead. You can configure the INROW storage threshold to balance storage space and access performance.

To avoid OUTROW storage, you can increase the INROW storage threshold by setting the ob_default_lob_inrow_threshold system variable to a larger value. Then, create a new table to verify whether the change takes effect.

Here is an example:

-- Set the INROW storage threshold to 8,192 bytes.	
SET ob_default_lob_inrow_threshold = 8192;

Notice

Modifying the ob_default_lob_inrow_threshold variable does not affect the INROW storage threshold of existing tables. It only applies to newly created tables where the INROW storage threshold is not explicitly specified.

Use more appropriate data types

In practice, we have observed that using LONGTEXT and JSON data types can lead to poor storage efficiency and slow access speeds in some scenarios, particularly when complex queries are not required. If JSON computations are unnecessary, we recommend storing JSON data in VARCHAR or TEXT columns instead. Choosing smaller data types for large datasets can reduce memory usage and improve access performance.

Upgrade OceanBase Database to an appropriate version

OceanBase Database of earlier versions may lack support for new features, potentially causing performance bottlenecks. To achieve better performance in high-concurrency read/write scenarios, we recommend upgrading OceanBase Database to V4.2.2, V4.3.1, or later. These versions include optimized OUTROW storage capabilities, which enhance the performance of read/write operations on LOBs and JSON data while reducing latency.

Example

Test environment

The test environment in this example is configured as follows:

  • CPU architecture: x86_64
  • CPU cores: 4
  • OceanBase Database version: V4.2.1 BP7

Symptom

This example involves a primary key query on a table with JSON columns, which results in slow performance. The SQL query and table creation statements are as follows:

SELECT
  *
FROM
  `t2_act`
WHERE
  `id` = 1
  AND `del_at` IS NULL
LIMIT
  1;

CREATE TABLE `t2_act` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,
  `page_setting` JSON DEFAULT NULL,
  `rule_setting` JSON DEFAULT NULL,
  `extend` JSON DEFAULT NULL,
  `del_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
);

To analyze the data length of the JSON columns, execute the following query:

SELECT /*+parallel(12)*/ max(length(page_setting)), min(length(rule_setting)), avg(length(extend)) FROM t2_act;
+--------------------------+--------------------------+--------------------+
| max(length(page_setting)) | min(length(rule_setting)) | avg(length(extend)) |
|                    17736 |                      928 |             113084 |
+--------------------------+--------------------------+--------------------+
1 row in set(0.196 sec)

The poor performance is caused by the query involving JSON columns, where the length of the JSON data exceeds the LOB storage threshold for INROW mode. This results in additional I/O operations to scan the JSON columns, significantly increasing the response time (RT).

Optimization solutions

  1. Upgrade to OceanBase Database V4.2.2 or later to optimize overheads.

  2. Increase the INROW storage threshold to avoid OUTROW storage. After modifying the threshold, recreate the table to ensure data is stored using the new storage mechanism.

  3. Use VARCHAR or TEXT columns for JSON data when calculations on JSON data are not required. For example, in this scenario, JSON data is only stored and not processed, making VARCHAR or TEXT a more efficient choice.

Previous topic

Best practices for updating hotspot rows
Last

Next topic

Best practices for semi-structured storage performance
Next
What is on this page
Background information
What is a LOB?
LOB storage modes
Performance challenges
Performance diagnostics and optimization solutions
Identify performance issues with OUTROW storage
Optimization solutions
Example
Test environment
Symptom
Optimization solutions