All Products
Search
Document Center

ApsaraDB for OceanBase:DescribeSQLSamples

Last Updated:Oct 23, 2024

You can call this API to view the sample data of the execution details of the 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:DescribeSQLSamplesget
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringNo

The instance ID.

ob317v4uif****
TenantIdstringNo

The tenant ID.

t4louaeei****
StartTimestringYes

The start time of querying the slow query execution. 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 the slow query execution. The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

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

The database name.

test_db
SqlIdstringYes

SQL ID.

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

Response parameters

ParameterTypeDescriptionExample
object

Returned response.

RequestIdstring

Request ID.

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

The list of sample data of slow query execution details.

Dataobject
RequestIdstring

Request ID.

EE205C00-30E4-****-****-87E3A8A2AA0C
TraceIdstring

Trace ID.

YB42C****-0005E303D1****-0-0
RequestTimestring

SQL request time.

2023-04-12T04:46:38Z
Serverstring

The server where the SQL is executed.

i-bp1db1****8uemejio
ClientIpstring

Client IP.

i-bp1db****38uemejio
ClientPortstring

Client port.

4****
DbNamestring

Database name.

test_db
UserNamestring

Username.

test_user
SqlTypestring

SQL type.

select
PlanIddouble

The execution plan ID.

590****
AffectedRowsdouble

Average updated rows during the execution period.

10000.0
ReturnRowsdouble

Average returned rows during the execution period.

0.0
PartitionCountdouble

Average number of partition accessed during the execution period.

1.0
RetCodedouble

Result code.

0
WaitEventstring

Longest wait event during the execution period.

none
WaitTimedouble

Wait time (in milliseconds).

0.0
WaitCountdouble

Wait count.

0.0
RpcCountdouble

Number of RPC sent.

8.0
PlanTypestring

Plan type.

LOCAL
Innerboolean

Whether an internal SQL.

false
ExecutorRpcdouble

Whether to initiate RPC.

0.0
HitPlandouble

Whether to hit the execution plan.

true
ElapsedTimedouble

Response time (in milliseconds).

2182.66
CpuTimedouble

CPU time (in milliseconds).

3377.57
NetTimedouble

Network transmission time (in milliseconds).

0.0
NetWaitTimedouble

Network enqueue time (in milliseconds).

0.0
QueueTimedouble

Queueing time (in milliseconds).

0.02
DecodeTimedouble

Syntax parsing time (in milliseconds).

0.0
GetPlanTimedouble

Plan generation time (in milliseconds).

0.19
ExecuteTimedouble

Plan execution time (in milliseconds).

8262.01
ApplicationWaitTimedouble

Application event waiting time (in milliseconds).

0.0
ConcurrencyWaitTimedouble

Concurrency event waiting time (in milliseconds).

0.0
UserIoWaitTimedouble

UserIO event waiting time (in milliseconds).

0.0
ScheduleTimedouble

Schedule event waiting time (in milliseconds).

0.0
RowCacheHitdouble

RowCache hit count.

498.0
BloomFilterCacheHitdouble

BloomFilterCache hit count.

0.0
BlockCacheHitdouble

BlockCache hit count

99279.0
BlockIndexCacheHitdouble

BlockIndexCache hit count

142514.0
DiskReadsdouble

Disk read count.

96972.0
RetryCountdouble

Retry count.

0
TableScandouble

Whether to perform full table scan.

false
ConsistencyLevelstring

Consistency level.

3
MemstoreReadRowsdouble

Memstore read row count.

0
ExpectedWorkerCountdouble

Degree of parallelism.

0
UsedWorkerCountdouble

Actual number of SQL execution threads.

0
SsstoreReadRowsdouble

Ssstore read row count.

986190
ObServerIddouble

Server ID.

2
ObUserIddouble

User ID.

100010
ObDbIddouble

Database ID.

11006111****4828
Statementstring

Parameterized SQL text.

select a from b
TransHashstring

Transaction hash.

1219****927****73791

Examples

Sample success responses

JSONformat

{
  "RequestId": "EE205C00-30E4-****-****-87E3A8A2AA0C",
  "Data": [
    {
      "RequestId": "EE205C00-30E4-****-****-87E3A8A2AA0C",
      "TraceId": "YB42C****-0005E303D1****-0-0",
      "RequestTime": "2023-04-12T04:46:38Z",
      "Server": "i-bp1db1****8uemejio",
      "ClientIp": "i-bp1db****38uemejio",
      "ClientPort": "4****",
      "DbName": "test_db",
      "UserName": "test_user",
      "SqlType": "select",
      "PlanId": 0,
      "AffectedRows": 10000,
      "ReturnRows": 0,
      "PartitionCount": 1,
      "RetCode": 0,
      "WaitEvent": "none",
      "WaitTime": 0,
      "WaitCount": 0,
      "RpcCount": 8,
      "PlanType": "LOCAL",
      "Inner": false,
      "ExecutorRpc": 0,
      "HitPlan": 0,
      "ElapsedTime": 2182.66,
      "CpuTime": 3377.57,
      "NetTime": 0,
      "NetWaitTime": 0,
      "QueueTime": 0.02,
      "DecodeTime": 0,
      "GetPlanTime": 0.19,
      "ExecuteTime": 8262.01,
      "ApplicationWaitTime": 0,
      "ConcurrencyWaitTime": 0,
      "UserIoWaitTime": 0,
      "ScheduleTime": 0,
      "RowCacheHit": 498,
      "BloomFilterCacheHit": 0,
      "BlockCacheHit": 99279,
      "BlockIndexCacheHit": 142514,
      "DiskReads": 96972,
      "RetryCount": 0,
      "TableScan": 0,
      "ConsistencyLevel": "3",
      "MemstoreReadRows": 0,
      "ExpectedWorkerCount": 0,
      "UsedWorkerCount": 0,
      "SsstoreReadRows": 986190,
      "ObServerId": 2,
      "ObUserId": 100010,
      "ObDbId": 0,
      "Statement": "select a from b",
      "TransHash": "1219****927****73791"
    }
  ]
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-08-15The response structure of the API has changedView Change Details
2024-04-15The request parameters of the API has changed. The response structure of the API has changedView Change Details
2023-12-11The response structure of the API has changedView Change Details
2023-10-30The response structure of the API has changedView Change Details