All Products
Search
Document Center

ApsaraDB for OceanBase:DescribeOasSQLPlans

Last Updated:Oct 23, 2024

You can call this API to retrieve information about the SQL execution plan stored in the diagnostic system based on the SQL ID.

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:DescribeOasSQLPlansget
  • 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 the SQL execution plan.
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 SQL execution plan.
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

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

The name of the database.

test_db
SqlIdstringYes

SQL ID.

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

Supported language. Valid values:

  • zh-CN: Chinese
  • en-US: English
zh-CN

Response parameters

ParameterTypeDescriptionExample
object

Returned response.

RequestIdstring

The request ID.

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

The list of SQL execution plan.

Dataobject
PlanHashinteger

The internal identifier of the SQL execution plan in the diagnostic system.

1758****24913166****
Plansarray<object>

The list of the execution plan.

Plansobject
Uidstring

The unique identifier of the plan.

AAAAAAAAAAI****AAFoT2QAF--7W****
PlanIdlong

The ID of the plan.

590****
FirstLoadTimestring

First time to load the plan.

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

Plan type, including LOCAL, REMOTE, DIST.

LOCAL
PlanHashinteger

The internal identifier of the SQL execution plan in the diagnostic system.

-86290582****886880
PlanSizelong

Plan size.

10****
SchemaVersionlong

Schema version.

16838****3550464
MergedVersionlong

Merge version.

513
ObServerIdlong

Server ID.

2
ObDbIdlong

Database ID.

11006****828
ServerIdlong

The ID of the backend server instance.

2
FirstLoadTimeUslong

First loading time.

1684****03289441
HitDiagnosisboolean

Whether to hit the diagnosis.

false
OutlineDatastring

The outline_data parameter of the SQL execution plan.

/*+ BEGIN_OUTLINE_DATA INDEX(@\"SEL$1\
OutlineIdlong

Outline ID.

-1
CollectTimeUslong

Collection time.

1684368****00000
Serverstring

The server where the SQL is executed.

i-bp1db1a9us038****jio
HitPercentagedouble

Hit rate.

100.0
Executionslong

The total number of executions during the execution period.

1
ExecPsdouble

The average execution count per second during the execution period.

0.31
AvgDiskReadsdouble

The average physical read count during the execution period.

0.0
AvgDiskWritesdouble

The average physical write count during the execution period.

0.0
AvgBufferGetsdouble

Average cache read count during the execution period.

30137.03
AvgApplicationWaitTimedouble

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

0.0
AvgConcurrencyWaitTimedouble

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

0.0
AvgUserIoWaitTimedouble

Average UserIo event waiting time (in milliseconds) during the execution period.

0.0
AvgRowProcesseddouble

Average row processing waiting time (in milliseconds) during the execution period.

1.0
AvgElapsedTimedouble

Average interval waiting time (in milliseconds) during the execution period.

1876.78
AvgCpuTimedouble

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

1875.34
LargeQueryPercentagedouble

Percentage of completed long-running queries.

0.0
DelayedLargeQueryPercentagedouble

Percentage of delayed long-running queries.

0.0
TimeoutPercentagedouble

Percentage of timeouts.

0.0
TableScanboolean

Whether a full table scan is performed.

false
PlanUnionHashstring

The internal unique identifier of the SQL execution plan in the diagnostic system.

"52c7c53****53e61b3f7586b17****ad"
MergedVersionlong

Merge version.

513
FirstLoadTimestring

First loading time.

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

Execution plan type.

LOCAL
HitDiagnosisnumber

Whether to hit the diagnosis.

false
HitPercentageboolean

Hit rate.

100.0
AvgCpuTimedouble

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

1875.34
PlanExplainobject

Execution plan.

PlanJsonStringstring

JSON string of the SQL execution plan.

{\"RootOperations\":[{\"Children\
Executionslong

Execution count.

1
PlanUnionHashstring

The internal unique identifier of the SQL execution plan in the diagnostic system.

"52c7c53****53e61b3f7586b17****ad"
QuerySqlstring

The SQL for the query.

"select 1 from t"
Boundedboolean

Whether to bind the execution plan.

false

Examples

Sample success responses

JSONformat

{
  "RequestId": "EE205C00-30E4-****-****-87E3A8A2AA0C",
  "Data": [
    {
      "PlanHash": 0,
      "Plans": [
        {
          "Uid": "AAAAAAAAAAI****AAFoT2QAF--7W****",
          "PlanId": 0,
          "FirstLoadTime": "2023-04-12T04:46:38Z",
          "PlanType": "LOCAL",
          "PlanHash": 0,
          "PlanSize": 0,
          "SchemaVersion": 0,
          "MergedVersion": 513,
          "ObServerId": 2,
          "ObDbId": 0,
          "ServerId": 2,
          "FirstLoadTimeUs": 0,
          "HitDiagnosis": false,
          "OutlineData": "/*+ BEGIN_OUTLINE_DATA INDEX(@\\\"SEL$1\\",
          "OutlineId": -1,
          "CollectTimeUs": 0,
          "Server": "i-bp1db1a9us038****jio",
          "HitPercentage": 100,
          "Executions": 1,
          "ExecPs": 0.31,
          "AvgDiskReads": 0,
          "AvgDiskWrites": 0,
          "AvgBufferGets": 30137.03,
          "AvgApplicationWaitTime": 0,
          "AvgConcurrencyWaitTime": 0,
          "AvgUserIoWaitTime": 0,
          "AvgRowProcessed": 1,
          "AvgElapsedTime": 1876.78,
          "AvgCpuTime": 1875.34,
          "LargeQueryPercentage": 0,
          "DelayedLargeQueryPercentage": 0,
          "TimeoutPercentage": 0,
          "TableScan": false,
          "PlanUnionHash": "\"52c7c53****53e61b3f7586b17****ad\""
        }
      ],
      "MergedVersion": 513,
      "FirstLoadTime": "2023-04-12T04:46:38Z",
      "PlanType": "LOCAL",
      "HitDiagnosis": 0,
      "HitPercentage": true,
      "AvgCpuTime": 1875.34,
      "PlanExplain": {
        "PlanJsonString": "{\\\"RootOperations\\\":[{\\\"Children\\"
      },
      "Executions": 1,
      "PlanUnionHash": "\"52c7c53****53e61b3f7586b17****ad\"",
      "QuerySql": "\"select 1 from t\"",
      "Bounded": false
    }
  ]
}

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 changedView Change Details
2023-08-21The request parameters of the API has changed. The response structure of the API has changedView Change Details