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.2.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.2.2
    iconOceanBase Database
    SQL - V 4.2.2
    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

    Cases

    Last Updated:2026-04-15 08:27:14  Updated
    share
    What is on this page
    share
    1. The system metrics show that the QPS_RT and TPS_RT of the tenant have soared.

      sample1

    2. The drill-down analysis indicates that the IOPS and data volume of disk reads have soared, which means SQL exceptions are possible.

      sample2

    3. Locate the suspicious SQL statements based on the information provided by the SQL audit feature.

      sample2

      The conclusions are as follows:

      • The values of the avg_logical_read field of the two SQL statements are 97 and 5, respectively.

      • The values of the cnt field indicate the high concurrency of the two SQL statements.

      High concurrency leads to a large disk I/O throughput, which results in the I/O wait of tenant worker threads and the values of the QUEUE_TIME field of all SQL statements exceed 30s.

    4. Analyze the suspicious SQL statements.

      • Obtain the text of one suspicious SQL statement.

        obclient> select query_sql from v$ob_sql_audit where sql_id in ('E49D99FE0221C22E9E65352924104224') limit 1\G
        *************************** 1. row ***************************
        query_sql:
        select *
        from t1
        where user_id = 'xxx' and product_type = 'xxx' and standard_category not in('xxx','xxx')           
        order by gmt_last_trans DESC  limit 35
        1 row in set (0.01 sec)
        

        The GV$OB_PLAN_CACHE_PLAN_EXPLAIN view indicates that this statement uses the user_id column as the index, which leads to a heavy workload of table access by index primary key if a large number of users are involved. Therefore, the index must be optimized.

        Taking account of other queries, the new index is (user_id, product_type, standard_category, gmt_last_trans).

      • Obtain the text of the other suspicious SQL statement.

        obclient> select query_sql from v$ob_sql_audit where sql_id in ('49E666DA7094F3C6089853875D94F8E6') limit 1\G
        *************************** 1. row ***************************
        query_sql:          
        select sum(trans_amount)  
        from t2   
        where a_id = 'xxx' and user_id = 'xxx' and trans_code = 'xxx' and out_date <= '20180831'
        1 row in set (0.00 sec)
        

        The GV$OB_PLAN_CACHE_PLAN_EXPLAIN view indicates that this statement uses the user_id column as the index, which leads to a heavy workload of table access by index primary key if a large number of users are involved. Therefore, the index must be optimized.

        Taking account of other queries, the new index is (a_id, trans_code, user_id, out_date, trans_amount).

    Previous topic

    Execution plans
    Last

    Next topic

    Overview
    Next