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 Cloud

    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 Cloud
    iconOceanBase Cloud
    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

      DescribeOasSQLTrends

      Last Updated:2026-04-16 06:25:31  Updated
      Share
      What is on this page
      Overview
      API details
      Constraints
      Request path
      Request parameters
      Response parameters
      Examples
      Request example
      Response example

      folded

      Share

      Overview

      You can call this API to query the SQL execution history.

      API details

      Constraints

      The caller must have an AccessKey for accessing the APIs. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.

      Request path

      GET /api/v2/open/instances/{instanceId}/tenants/{tenantId}/sqls/{sqlId}/trends

      Request parameters

      Path

      Parameter
      Type
      Required
      Description
      Example
      instanceId String Yes The ID of the instance. obcluster-*****
      tenantId String Yes The ID of the tenant. t4louaeei****
      sqlId String Yes The ID of the SQL statement. sql_123456789

      Query

      Parameter
      Type
      Required
      Description
      Example
      requestId String No The ID of the request. This parameter is used for troubleshooting. dc302d76-66b5-48d8-ab53-a035********
      startTime String No The start time of the query in UTC format. 2026-02-25 15:40:43+00:00
      endTime String No The end time of the query in UTC format. 2026-02-26 10:40:43+00:00
      dbName String No The name of the database. test_db
      nodeIp String No The IP address of the node. 10.0.0.1
      dynamicSql Boolean No Specifies whether the SQL statement is dynamic. true

      Response parameters

      Parameter
      Type
      Description
      Example
      data Object Data. {}
      dataList Array Data list. []
      avgAffectedRows Double Average number of rows updated during the period. 0.0
      avgApplicationWaitTime Double Average Application event wait time during the period (in milliseconds). 0.0
      avgBlockCacheHit Double Average number of BlockCache hits during the period. 0.0
      avgBlockIndexCacheHit Double Average number of BlockIndexCache hits during the period. 0.0
      avgBloomFilterCacheHit Double Average number of BloomFilterCache hits during the period. 0.0
      avgConcurrencyWaitTime Double Average Concurrency event wait time during the period. 0.0
      avgCpuTime Double Average CPU time during the period (in milliseconds). 444.86
      avgDbTime Double Average database time (in milliseconds). 444.87
      avgDecodeTime Double Average syntax parsing time during the period (in milliseconds). 0.0
      avgDiskReads Double Average number of physical reads during the period. 0.0
      avgElapsedTime Double Average response time during the period (in milliseconds). 450.71
      avgExecuteTime Double Average plan execution time during the period (in milliseconds). 444.82
      avgExecutorRpcCount Double Average number of executed RPC requests during the period. 0.0
      avgGetPlanTime Double Average plan generation time during the period (in milliseconds). 0.04
      avgLogicalReads Double Average number of logical reads. 0.0
      avgMemstoreReadRows Double Average number of Memstore reads during the period. 0.0
      avgNetTime Double Average network transmission time during the period (in milliseconds). 0.0
      avgNetWaitTime Double Average network enqueue time during the network wait period (in milliseconds). 0.0
      avgPartitionCount Double Average number of partitions during the period. 1.0
      avgQueueTime Double Average queueing time during the period (in milliseconds). 5.85
      avgReturnRows Double Average number of returned rows during the period. 0.52
      avgRowCacheHit Double Average number of RowCache hits during the period. 0.0
      avgRpcCount Double Average number of RPC requests during the period. 0.0
      avgScheduleTime Double Average Schedule event wait time during the scheduling period (in milliseconds). 0.0
      avgSsstoreReadRows Double Average number of SsStore reads during the period. 271.99
      avgUserIoWaitTime Double Average UserIO event wait time during the period (in milliseconds). 0.0
      avgWaitCount Double Average number of waits during the period. 0.0
      avgWaitTime Double Average wait time during the period (in milliseconds). 0.0
      dbName String Database name. test11
      distPlanPercentage Double Percentage of distributed plans. 0.0
      execPs Double Percentage of executed PS. 4.15
      executions Long Number of executions. 249
      failCount Long Number of failed executions. 0
      failPercentage Double Failure percentage. 0.0
      localPlanPercentage Double Percentage of local plans. 100.0
      maxCpu Time Double Maximum CPU time (in milliseconds). 1949.68
      maxElapsedTime Double Maximum response time (in milliseconds). 1956.43
      missPlanPercentage Double Percentage of missed plans. 0.0
      missPlans Long Number of missed plans. 0
      remotePlanPercentage Double Percentage of remote plans. 0.0
      remotePlans Long Number of remote plans. 0
      retCode4012Count Long Number of times return code 4012 is returned. 0
      retCode4013Count Long Number of times return code 4013 is returned. 0
      retCode5001Count Long Number of times return code 5001 is returned. 0
      retCode5024Count Long Number of times return code 5024 is returned. 0
      retCode5167Count Long Number of times return code 5167 is returned. 0
      retCode5217Count Long Number of times return code 5217 is returned. 0
      retCode6002Count Long Number of times return code 6002 is returned. 0
      retryCount Long Number of retries. 0
      server String Server name. i-uf********
      serverIp String Server IP address. xx.xx.xx.xx
      strongConsistencyPercentage Double Percentage of strong consistency. 100.0
      sumDbTime Double Total database time (in milliseconds). 110771.68
      sumElapsedTime Double Total response time (in milliseconds). 112227.44
      sumLogicalReads Double Total number of logical reads. 0.0
      sumWaitTime Double Total wait time (in milliseconds). 0.0
      tableScanPercentage Double Percentage of table scans. 100.0
      timestamp String Timestamp. 2025-12-23T06:48:08Z
      userName String Username. test_mysql
      waitEvent String Wait event. none
      weakConsistencyPercentage Double Percentage of weak consistency. 0.0

      Examples

      Request example

      curl --digest -u '<Your ak:sk>' \
          -X GET \
          'https://api-cloud.oceanbase.com/api/v2/open/instances/{instanceId}/tenants/{tenantId}/sqls/{sqlId}/trends?requestId={requestId}&startTime={startTime}&endTime={endTime}&dbName={dbName}&nodeIp={nodeIp}&dynamicSql={dynamicSql}'
      

      Response example

      JSON format

      {
          "data": {
              "dataList": [
                  {
                      "avgAffectedRows": 0.0,
                      "avgApplicationWaitTime": 0.0,
                      "avgBlockCacheHit": 0.0,
                      "avgBlockIndexCacheHit": 0.0,
                      "avgBloomFilterCacheHit": 0.0,
                      "avgConcurrencyWaitTime": 0.0,
                      "avgCpuTime": 444.86,
                      "avgDbTime": 444.87,
                      "avgDecodeTime": 0.0,
                      "avgDiskReads": 0.0,
                      "avgElapsedTime": 450.71,
                      "avgExecuteTime": 444.82,
                      "avgExecutorRpcCount": 0.0,
                      "avgGetPlanTime": 0.04,
                      "avgLogicalReads": 0.0,
                      "avgMemstoreReadRows": 0.0,
                      "avgNetTime": 0.0,
                      "avgNetWaitTime": 0.0,
                      "avgPartitionCount": 1.0,
                      "avgQueueTime": 5.85,
                      "avgReturnRows": 0.52,
                      "avgRowCacheHit": 0.0,
                      "avgRpcCount": 0.0,
                      "avgScheduleTime": 0.0,
                      "avgSsstoreReadRows": 271.99,
                      "avgUserIoWaitTime": 0.0,
                      "avgWaitCount": 0.0,
                      "avgWaitTime": 0.0,
                      "dbName": "test11",
                      "distPlanPercentage": 0.0,
                      "execPs": 4.15,
                      "executions": 249,
                      "failCount": 0,
                      "failPercentage": 0.0,
                      "localPlanPercentage": 100.0,
                      "maxCpuTime": 1949.68,
                      "maxElapsedTime": 1956.43,
                      "missPlanPercentage": 0.0,
                      "missPlans": 0,
                      "remotePlanPercentage": 0.0,
                      "remotePlans": 0,
                      "retCode4012Count": 0,
                      "retCode4013Count": 0,
                      "retCode5001Count": 0,
                      "retCode5024Count": 0,
                      "retCode5167Count": 0,
                      "retCode5217Count": 0,
                      "retCode6002Count": 0,
                      "retryCount": 0,
                      "server": "xxx.xxx.x.xxx:xxxx",
                      "serverIp": "xx.xx.xx.xx",
                      "strongConsistencyPercentage": 100.0,
                      "sumDbTime": 110771.68,
                      "sumElapsedTime": 112227.44,
                      "sumLogicalReads": 0.0,
                      "sumWaitTime": 0.0,
                      "tableScanPercentage": 100.0,
                      "timestamp": "2025-12-23T06:48:08Z",
                      "userName": "test_mysql",
                      "waitEvent": "none",
                      "weakConsistencyPercentage": 0.0
                  }
              ],
              "total": 1
          },
          "requestId": "87b69bed-98e9-455d-a68d-268105d3a954",
          "success": true
      }
      

      Previous topic

      DescribeOasSlowSQLSamples
      Last

      Next topic

      DescribeOasSQLPlanGroup
      Next
      What is on this page
      Overview
      API details
      Constraints
      Request path
      Request parameters
      Response parameters
      Examples
      Request example
      Response example