All Products
Search
Document Center

AnalyticDB:DescribeDiagnosisSQLInfo

Last Updated:Mar 17, 2026

View the execution details of a specific SQL statement, including its execution plan, runtime information, resource usage, and self-diagnosis results.

Operation description

For more information, see Endpoints.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

adb:DescribeDiagnosisSQLInfo

list

*DBClusterLakeVersion

acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DBClusterId

string

Yes

The cluster ID.

Note

Call the DescribeDBClusters operation to query the IDs of AnalyticDB for MySQL clusters in a specific region.

amv-bp1r053by****

RegionId

string

Yes

The region ID.

Note

Call the DescribeRegions operation to query the IDs of regions that AnalyticDB for MySQL supports.

cn-hangzhou

ProcessId

string

No

The query ID.

Note

Call the DescribeDiagnosisRecords operation to query the summary information about SQL statements in a specific AnalyticDB for MySQL cluster. The summary information includes the query ID.

20210702164322172016168****

ProcessStartTime

integer

No

The time when the SQL statement started to run. The time is a UNIX timestamp. Unit: milliseconds (ms).

Note

Call the DescribeDiagnosisRecords operation to query the summary information about SQL statements in a specific AnalyticDB for MySQL cluster. The summary information includes the start time of the SQL statement.

1625215402000

ProcessState

string

No

The state of the SQL statement. Valid values:

  • running: The SQL statement is running.

  • finished: The SQL statement is complete.

  • failed: The SQL statement failed.

Note

Call the DescribeDiagnosisRecords operation to query the summary information about SQL statements in a specific AnalyticDB for MySQL cluster. The summary information includes the state of the SQL statement.

running

Lang

string

No

The language of the downloaded file title and some error messages. Valid values:

  • zh: Simplified Chinese.

  • en: English.

  • ja: Japanese.

  • zh-tw: Traditional Chinese.

zh

ProcessRcHost

string

No

The IP address and port of the frontend node that runs the SQL statement.

Note

Call the DescribeDiagnosisRecords operation to query the summary information about SQL statements in a specific AnalyticDB for MySQL cluster. The summary information includes the IP address and port of the frontend node.

192.45.***.***:3145

Response elements

Element

Type

Description

Example

object

DiagnosisSQLInfo

string

The execution details of the SQL statement. The details include the SQL statement, statistics, execution plan, and operator information.

{ "DiagnosisSQLInfo": { "hasSharedStage": false, "resourceGroup": "user_default", "cost": 274, "queuedTime": 0, "outputDataSize": 9, "scheduled": true, "query": "/*+display=tpch_q14*/SELECT 100.00 * SUM(CASE WHEN p_type LIKE 'PROMO%' THEN l_extendedprice * (1 - l_discount) ELSE 0 END) / SUM(l_extendedprice * (1 - l_discount)) AS promo_revenue FROM lineitem l, part p WHERE l_partkey = p_partkey AND l_shipdate >= DATE '1995-09-01' AND l_shipdate < DATE '1995-09-01' + INTERVAL '1' MONTH", "outputRows": 1, "userName": "test_user", "parentId": 0, "maxOutputRows": 200000, "scanSize": 8247470, "peakMemory": 13188295, "startTime": 1626330527632, "state": "FINISHED", "endTime": 1626330527905, "writeTableRows": 0, "scanRows": 351966 } }

RequestId

string

The request ID.

1

StageInfos

array<object>

The stage-by-stage execution information of the query.

object

The stage-by-stage execution information of the query.

InputRows

integer

The total number of input rows in the stage.

2341

InputDataSize

integer

The total amount of input data in the stage. Unit: bytes.

2341

OutputRows

integer

The total number of output rows in the stage.

2341

OutputDataSize

integer

The total amount of output data in the stage. Unit: bytes.

2341

PeakMemory

integer

The peak memory usage of the stage. Unit: bytes.

2341

OperatorCost

integer

The total time consumed by the operators in the stage. Unit: milliseconds (ms).

2341

StageId

string

The stage ID.

Stage[26]

State

string

The stage state.

RUNNING

Progress

number

The execution progress of the stage.

0.3

ExecutionType

string

Examples

Success response

JSON format

{
  "DiagnosisSQLInfo": "{     \"DiagnosisSQLInfo\": {         \"hasSharedStage\": false,         \"resourceGroup\": \"user_default\",         \"cost\": 274,         \"queuedTime\": 0,         \"outputDataSize\": 9,         \"scheduled\": true,         \"query\": \"/*+display=tpch_q14*/SELECT 100.00 * SUM(CASE WHEN p_type LIKE 'PROMO%' THEN l_extendedprice * (1 - l_discount) ELSE 0 END) / SUM(l_extendedprice * (1 - l_discount)) AS promo_revenue FROM lineitem l, part p WHERE l_partkey = p_partkey AND l_shipdate >= DATE '1995-09-01' AND l_shipdate < DATE '1995-09-01' + INTERVAL '1' MONTH\",         \"outputRows\": 1,         \"userName\": \"test_user\",         \"parentId\": 0,         \"maxOutputRows\": 200000,         \"scanSize\": 8247470,         \"peakMemory\": 13188295,         \"startTime\": 1626330527632,         \"state\": \"FINISHED\",         \"endTime\": 1626330527905,         \"writeTableRows\": 0,         \"scanRows\": 351966     } }",
  "RequestId": "1",
  "StageInfos": [
    {
      "InputRows": 2341,
      "InputDataSize": 2341,
      "OutputRows": 2341,
      "OutputDataSize": 2341,
      "PeakMemory": 2341,
      "OperatorCost": 2341,
      "StageId": "Stage[26]",
      "State": "RUNNING",
      "Progress": 0.3,
      "ExecutionType": ""
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.