All Products
Search
Document Center

ApsaraDB for OceanBase:DescribeOasSlowSQLList

Last Updated:Oct 23, 2024

You can call this API to view a list of slow queries.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
oceanbase:DescribeOasSlowSQLListget
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the OceanBase cluster.

ob317v4uif****
TenantIdstringYes

The ID of the tenant.

t4louaeei****
StartTimestringYes

The start time of querying slow SQL historical parameters.
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

2023-04-12T04:38:38Z
EndTimestringYes

The end time of querying slow SQL historical parameters.
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

2023-04-12T05:38:38Z
DbNamestringNo

The name of the database.

test_db
SearchKeyWordstringNo

The search keyword.

update
SearchParamstringNo

The search parameter.

cputime
SearchRulestringNo

The search rule.

>
SearchValuestringNo

The search value.

0.01
SqlIdstringNo

SQL ID, the unique identifier of the SQL.

8D6E84****0B8FB1823D199E2CA1****
NodeIpstringNo

The IP of the database node.

i-bp18qljorblo8es*****
FilterConditionstringNo

All parameters are referenced by the symbol @. For a list of available parameters, refer to the returned parameters in Query performance indicators of an SQL statement.

@avgCpuTime > 20 and @executions > 100
AcceptLanguagestringNo

The language of the response.

zh-CN
SqlTextLengthlongNo

Max length of the returned SQL text.

65535

Response parameters

ParameterTypeDescriptionExample
object

Returned response.

RequestIdstring

The request ID.

EE205C00-30E4-****-****-87E3A8A2AA0C
Dataarray<object>

The list of slow queries.

Dataobject
Executionsdouble

Total number of executions during the execution period.

1
RpcCountdouble

RPC count during the execution period.

0
RemotePlansdouble

Remote execution count during the execution period.

0
MissPlansdouble

Missed hit count of the execution plan during the execution period.

0
MaxElapsedTimedouble

Max response time during the execution period.

260.044
TotalWaitTimedouble

Total wait time during the execution period.

10.966
ExecPsdouble

Average execution count per second during the execution period.

0.31
MaxCpuTimedouble

Max CPU time.

257.967
ClientIpstring

Client IP.

1*2.***.1*3.***
UserNamestring

Username.

test_user
DbNamestring

The name of the database.

test_db
RetCode4012Countlong

Number of occurrences of code 4012 during the execution period.

0
RetCode4013Countlong

Number of occurrences of code 4013 during the execution period.

0
RetCode5001Countlong

Number of occurrences of code 5001 during the execution period.

0
RetCode5024Countlong

Number of occurrences of code 5024 during the execution period.

0
RetCode5167Countlong

Number of occurrences of code 5167 during the execution period.

0
RetCode5217Countlong

Number of occurrences of code 5217 during the execution period.

0
RetCode6002Countlong

Number of occurrences of code 6002 during the execution period.

0
FailPercentagedouble

Error percentage during the execution period.

0.0
SumWaitTimedouble

The total wait time (in milliseconds) during the internal waiting period.

9421.73
AvgWaitCountdouble

Average number of waits during the execution period.

0.0
AvgRpcCountdouble

Average number of RPC sent during the execution.

8.0
LocalPlanPercentagedouble

Local plan percentage during the execution period.

0.0
RemotePlanPercentagedouble

Remote plan percentage during the execution period.

0.0
DistPlanPercentagedouble

Distributed plan percentage during the execution period.

100.0
SumElapsedTimedouble

Total response time (in milliseconds) during the execution period.

11452126.36
AvgNetTimedouble

Average network transmission time (in milliseconds) during the execution period.

0.0
AvgExecutorRpcCountdouble

Average number of RPC requests executed during the execution period.

0.0
MissPlanPercentagedouble

Plan hit rage during the execution period.

0.0
TableScanPercentagedouble

Table scan percentage during the execution period.

0.0
StrongConsistencyPercentagedouble

Strong consistent transaction percentage during the execution period.

100.0
WeakConsistencyPercentagedouble

Eventually consistent transaction percentage during the execution period.

0.0
MaxAffectedRowsdouble

Max affected rows during the execution period.

10000.0
MaxReturnRowsdouble

Max returned rows during the execution period.

0.0
MaxWaitTimedouble

Max wait time (in milliseconds) during the execution period.

3.4
MaxApplicationWaitTimedouble

Max Application event wait time (in milliseconds) during the execution period

0.0
MaxConcurrencyWaitTimedouble

Max Concurrency event wait time (in milliseconds) during the execution period

0.0
MaxUserIoWaitTimedouble

Max UserIO event wait time (in milliseconds) during the execution period.

0.0
MaxDiskReadsdouble

Max physical read count during the execution period.

0.0
AvgExpectedWorkerCountdouble

Average degree of parallelism during the execution period.

3
AvgUsedWorkerCountdouble

Average number of threads used of the SQL during the execution period.

3
SumLogicalReadsdouble

Total logical reads of the SQL during the execution period.

0.0
Serverstring

The server where the SQL is executed.

i-bp1db1a**s038**mej**
ServerIpstring

The IP address of the server.

i-bp1db1a**s038**mej**
ServerPortlong

The server port where the SQL is executed.

10110
SqlTextShortstring

SQL text (the first 100 characters).

select a from b where
SqlTypestring

SQL type.

select
SqlIdstring

SQL ID.

8D6E84****0B8FB1823D199E2CA1****
Innerboolean

Whether an internal SQL.

false
WaitEventstring

Longest wait event during the execution period.

none
AvgAffectedRowsdouble

Average updated rows during the execution period.

9978.75
AvgReturnRowsdouble

Average number of rows returned during the execution period.

0.0
AvgPartitionCountdouble

Average number of partition accessed during the execution period.

1.0
FailCountdouble

Average number of partition accessed during the execution period.

0
AvgWaitTimedouble

Average wait time (in milliseconds) during the execution period.

1.42
AvgElapsedTimedouble

Average response time (in milliseconds) during the execution period.

1876.78
AvgCpuTimedouble

Average CPU time (in milliseconds) during the execution period.

1875.34
AvgNetWaitTimedouble

Average network enqueue time (in milliseconds) during the network waiting period.

0.0
AvgQueueTimedouble

Average queueing time (in milliseconds) during the execution period.

0.01
AvgDecodeTimedouble

Average syntax parsing time (in milliseconds) during the execution period.

0.0
AvgGetPlanTimedouble

Average plan generation time (in milliseconds) during the execution period.

0.0
AvgExecuteTimedouble

Average plan execution time (in milliseconds) during the execution period.

1895.7
AvgApplicationWaitTimedouble

Average Application event wait time (in milliseconds) during the client waiting period.

0.0
AvgConcurrencyWaitTimedouble

Average Concurrency event wait time (in milliseconds) during the execution period.

0.0
AvgUserIoWaitTimedouble

Average UserIO event wait time (in milliseconds) during the execution period.

0.0
AvgScheduleTimedouble

Average Schedule event wait time (in milliseconds) during the scheduling period.

0.0
AvgRowCacheHitdouble

Average RowCache hit count during the execution period.

0.0
AvgBloomFilterCacheHitdouble

Average BloomFilterCache hit count during the execution period.

0.0
AvgBlockCacheHitdouble

Average BlockCache hit count during the execution period.

0.0
AvgBlockIndexCacheHitdouble

Average BlockIndexCache hit count during the execution period.

0.0
AvgDiskReadsdouble

Average physical read count during the execution period.

0.0
RetryCountdouble

Total number of retries during the execution period.

5
AvgMemstoreReadRowsdouble

Strong consistent transaction percentage during the execution period.

0.0
AvgSsstoreReadRowsdouble

Eventually consistent transaction percentage during the execution period.

0.0
AvgLogicalReadsdouble

Average logical reads of the SQL during the execution period.

0.0

Examples

Sample success responses

JSONformat

{
  "RequestId": "EE205C00-30E4-****-****-87E3A8A2AA0C",
  "Data": [
    {
      "Executions": 1,
      "RpcCount": 0,
      "RemotePlans": 0,
      "MissPlans": 0,
      "MaxElapsedTime": 260.044,
      "TotalWaitTime": 10.966,
      "ExecPs": 0.31,
      "MaxCpuTime": 257.967,
      "ClientIp": "1*2.***.1*3.***",
      "UserName": "test_user",
      "DbName": "test_db",
      "RetCode4012Count": 0,
      "RetCode4013Count": 0,
      "RetCode5001Count": 0,
      "RetCode5024Count": 0,
      "RetCode5167Count": 0,
      "RetCode5217Count": 0,
      "RetCode6002Count": 0,
      "FailPercentage": 0,
      "SumWaitTime": 9421.73,
      "AvgWaitCount": 0,
      "AvgRpcCount": 8,
      "LocalPlanPercentage": 0,
      "RemotePlanPercentage": 0,
      "DistPlanPercentage": 100,
      "SumElapsedTime": 11452126.36,
      "AvgNetTime": 0,
      "AvgExecutorRpcCount": 0,
      "MissPlanPercentage": 0,
      "TableScanPercentage": 0,
      "StrongConsistencyPercentage": 100,
      "WeakConsistencyPercentage": 0,
      "MaxAffectedRows": 10000,
      "MaxReturnRows": 0,
      "MaxWaitTime": 3.4,
      "MaxApplicationWaitTime": 0,
      "MaxConcurrencyWaitTime": 0,
      "MaxUserIoWaitTime": 0,
      "MaxDiskReads": 0,
      "AvgExpectedWorkerCount": 3,
      "AvgUsedWorkerCount": 3,
      "SumLogicalReads": 0,
      "Server": "i-bp1db1a**s038**mej**",
      "ServerIp": "i-bp1db1a**s038**mej**",
      "ServerPort": 10110,
      "SqlTextShort": "select a from b where",
      "SqlType": "select ",
      "SqlId": "8D6E84****0B8FB1823D199E2CA1****",
      "Inner": false,
      "WaitEvent": "none",
      "AvgAffectedRows": 9978.75,
      "AvgReturnRows": 0,
      "AvgPartitionCount": 1,
      "FailCount": 0,
      "AvgWaitTime": 1.42,
      "AvgElapsedTime": 1876.78,
      "AvgCpuTime": 1875.34,
      "AvgNetWaitTime": 0,
      "AvgQueueTime": 0.01,
      "AvgDecodeTime": 0,
      "AvgGetPlanTime": 0,
      "AvgExecuteTime": 1895.7,
      "AvgApplicationWaitTime": 0,
      "AvgConcurrencyWaitTime": 0,
      "AvgUserIoWaitTime": 0,
      "AvgScheduleTime": 0,
      "AvgRowCacheHit": 0,
      "AvgBloomFilterCacheHit": 0,
      "AvgBlockCacheHit": 0,
      "AvgBlockIndexCacheHit": 0,
      "AvgDiskReads": 0,
      "RetryCount": 5,
      "AvgMemstoreReadRows": 0,
      "AvgSsstoreReadRows": 0,
      "AvgLogicalReads": 0
    }
  ]
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-06-06The response structure of the API has changedView Change Details
2024-04-15The response structure of the API has changedView Change Details
2023-08-21The request parameters of the API has changed. The response structure of the API has changedView Change Details