All Products
Search
Document Center

ApsaraDB for OceanBase:DescribeOasSQLPlans

Last Updated:Apr 29, 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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

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
Dataobject []

The list of SQL execution plan.

PlanHashinteger

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

1758****24913166****
Plansobject []

The list of the execution plan.

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-04-15The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: PlanUnionHash
    Added Input Parameters: ReturnBriefInfo
2023-08-21The request parameters of the API has changed. The response structure of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: DynamicSql
Output ParametersThe response structure of the API has changed.