All Products
Search
Document Center

ApsaraDB for OceanBase:DescribeSQLPlans

Last Updated:Apr 29, 2024

You can call this operation to query the information about the SQL execution plans stored in the diagnostic system based on an 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
TenantIdstringYes

The ID of the tenant.

t2mr3oae0****
SQLIdstringYes

SQLID.

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

Response parameters

ParameterTypeDescriptionExample
object

The return result of the request.

RequestIdstring

The request ID.

EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C
SQLPlansobject []

The information about the execution plan.

HitCountinteger

The number of hits.

3
OutlineDatastring

The outline data.

/*+ BEGIN_OUTLINE_DATA FULL(@\"SEL$1\" \"testdb1.bmsql_order_line\"@\"SEL$1\") END_OUTLINE_DATA*/
AvgExecutionMSfloat

The average execution duration, in ms.

1
PlanUnionHashstring

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

859ef7ee****b23ac98cdeb2476f****
OutlineIdlong

OutlineID.

-1
AvgExecutionTimeMSlong

The average execution duration when the database uses this execution plan, in ms.

288
PlanIdinteger

The ID of the SQL execution plan in the database.

9114
OutlineTimelong

The time when the plan was bound.

1641492303000
OutlineTimeUTCStringstring

The time when the plan was bound, in UTC +0.

2022-01-06T18:05:03Z
PlanFullstring

The complete execution plan of the SQL statement.

PHY_TABLE_SCAN | bmsql_order_line | 40 ******
NodeIpstring

The IP address of the node.

i-bp16niirq4zdmgvm****
MergedVersioninteger

The major compaction version.

132
QuerySQLstring

The query SQL statement.

SELECT ol_i_id, ***, *** FROM aaa
FirstLoadTimeUTCStringstring

The time when the plan was loaded for the first time, in UTC +0.

2022-01-06T18:05:03Z
FirstLoadTimelong

The time when the plan was loaded for the first time, .

1641492303000
PlanInfostring

The information about the plan.

PHY_TABLE_SCAN

Examples

Sample success responses

JSONformat

{
  "RequestId": "EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C",
  "SQLPlans": [
    {
      "HitCount": 3,
      "OutlineData": "/*+ BEGIN_OUTLINE_DATA FULL(@\\\"SEL$1\\\" \\\"testdb1.bmsql_order_line\\\"@\\\"SEL$1\\\") END_OUTLINE_DATA*/",
      "AvgExecutionMS": 1,
      "PlanUnionHash": "859ef7ee****b23ac98cdeb2476f****",
      "OutlineId": -1,
      "AvgExecutionTimeMS": 288,
      "PlanId": 9114,
      "OutlineTime": 1641492303000,
      "OutlineTimeUTCString": "2022-01-06T18:05:03Z",
      "PlanFull": "PHY_TABLE_SCAN | bmsql_order_line | 40 ******",
      "NodeIp": "i-bp16niirq4zdmgvm****",
      "MergedVersion": 132,
      "QuerySQL": "SELECT ol_i_id, ***, *** FROM aaa",
      "FirstLoadTimeUTCString": "2022-01-06T18:05:03Z",
      "FirstLoadTime": 1641492303000,
      "PlanInfo": "PHY_TABLE_SCAN"
    }
  ]
}

Error codes

HTTP status codeError codeError message
2014InternalErrorThe request processing has failed due to some unknown error.

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

Change history

Change timeSummary of changesOperation
2022-01-17The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 2014
Output ParametersThe response structure of the API has changed.