Queries the execution details of an SQL statement, including the execution plan, runtime information, resource usage, and self-diagnostics results.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
adb:DescribeDiagnosisSQLInfo |
get |
DBCluster
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBClusterId |
string |
Yes |
The ID of the cluster. Note
You can call the DescribeDBClusters operation to query the cluster IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a specific region. |
am-bp1r053byu48p**** |
| RegionId |
string |
Yes |
The region ID of the cluster. Note
You can call the DescribeRegions operation to query the most recent region list. |
cn-hangzhou |
| ProcessId |
string |
Yes |
The ID of the query. Note
You can call the DescribeDiagnosisRecords operation to query the SQL summary information of a specified AnalyticDB for MySQL cluster, including the query ID. |
2021070216432217201616806503453****** |
| ProcessStartTime |
integer |
No |
The execution start time of the SQL statement, in UNIX timestamp format. Unit: milliseconds. Note
You can call the DescribeDiagnosisRecords operation to query the SQL summary information of a specified AnalyticDB for MySQL cluster, including the execution start time of the SQL statement. |
1625215402000 |
| ProcessState |
string |
No |
The execution state of the SQL statement. Valid values:
Note
You can call the DescribeDiagnosisRecords operation to query the SQL summary information of a specified AnalyticDB for MySQL cluster, including the state of the SQL statement. |
running |
| Lang |
string |
Yes |
The language of file titles and error messages. Valid values:
|
zh |
| ProcessRcHost |
string |
No |
The IP address and port number of the AnalyticDB for MySQL frontend node that executes the SQL statement. Note
You can call the DescribeDiagnosisRecords operation to query the SQL summary information of a specified AnalyticDB for MySQL cluster, including the IP address and port number of the frontend node. |
192.45.***.***:3145 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| DiagnosisSQLInfo |
string |
The execution details of the SQL statement, including the statement text, 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 execution details of the query, broken down by stage. |
|
|
object |
|||
| InputRows |
integer |
The total number of input rows in the stage. |
123 |
| 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. |
231 |
| OutputDataSize |
integer |
The total amount of output data in the stage. Unit: bytes. |
12344 |
| PeakMemory |
integer |
The total peak memory of the stage. Unit: bytes. |
3421 |
| OperatorCost |
integer |
The total time consumed by all operators in the stage. Unit: milliseconds. |
2341 |
| StageId |
string |
The stage ID. |
Stage[26] |
| State |
string |
The execution state of the stage. Valid values:
|
RUNNING |
| Progress |
number |
The execution progress of the stage. |
0.3 |
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": 123,
"InputDataSize": 2341,
"OutputRows": 231,
"OutputDataSize": 12344,
"PeakMemory": 3421,
"OperatorCost": 2341,
"StageId": "Stage[26]",
"State": "RUNNING",
"Progress": 0.3
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.