All Products
Search
Document Center

AnalyticDB:DescribeDiagnosisSQLInfo

Last Updated:Nov 10, 2025

Queries the execution information about an SQL statement, including the execution plan, execution information, resource usage, and self-diagnostics results.

Operation description

For information about the endpoints of AnalyticDB for MySQL, see Endpoints .

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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
adb:DescribeDiagnosisSQLInfolist
*DBClusterLakeVersion
acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBClusterIdstringYes

The cluster ID.

Note You can call the DescribeDBClusters operation to query the IDs of all AnalyticDB for MySQL Data Lakehouse Edition (V3.0) clusters within a region.
amv-bp1r053byu48p
RegionIdstringYes

The region ID of the cluster.

Note You can call the DescribeRegions operation to query the most recent region list.
cn-hangzhou
ProcessIdstringYes

The query ID.

Note You can call the DescribeDiagnosisRecords operation to query the diagnostic information about SQL statements for an AnalyticDB for MySQL cluster, including the query ID.
2021070216432217201616806503453
ProcessStartTimelongYes

The execution start time of the SQL statement. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

Note You can call the DescribeDiagnosisRecords operation to query the diagnostic information about SQL statements for an AnalyticDB for MySQL cluster, including the execution start time of the SQL statement.
1625215402000
ProcessStatestringYes

The status of the SQL statement. Valid values:

  • running
  • finished
  • failed
Note You can call the DescribeDiagnosisRecords operation to query the diagnostic information about SQL statements for an AnalyticDB for MySQL cluster, including the status of the SQL statement.
running
LangstringYes

The language of file titles and error messages. Valid values:

  • zh: simplified Chinese.
  • en: English.
  • ja: Japanese.
  • zh-tw: traditional Chinese.
zh
ProcessRcHoststringYes

The IP address and port number of the AnalyticDB for MySQL frontend node on which the SQL statement is executed.

Note You can call the DescribeDiagnosisRecords operation to query the diagnostic information about SQL statements for an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster, including the IP address and port number of the frontend node.
192.45.***.***:3145

Response parameters

ParameterTypeDescriptionExample
object
DiagnosisSQLInfostring

The queried execution information, including 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 } }
RequestIdstring

The request ID.

1
StageInfosarray<object>

The queried execution information by stage.

StageInfosobject
InputRowslong

The total number of input rows in the stage.

2341
InputDataSizelong

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

2341
OutputRowslong

The total number of output rows in the stage.

2341
OutputDataSizelong

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

2341
PeakMemorylong

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

2341
OperatorCostlong

The total amount of time consumed by all operators in the stage. Unit: milliseconds.

2341
StageIdstring

The stage ID.

Stage[26]
Statestring

The state of the stage.

RUNNING
Progressdouble

The execution progress of the stage.

0.3

Examples

Sample success responses

JSONformat

{
  "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 &gt;= DATE '1995-09-01' AND l_shipdate &lt; 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

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

Change history

Change timeSummary of changesOperation
2024-01-05The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-07-26The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-07-26The internal configuration of the API is changed, but the call is not affectedView Change Details