Queries the plan information about an SQL statement, such as a query statement or an extract-transform-load (ETL) task statement.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
adb:DescribeSQLPlan |
get |
DBCluster
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBClusterId |
string |
Yes |
The cluster ID. Note
You can call the DescribeDBClusters operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs. |
am-**************** |
| ProcessId |
string |
Yes |
The query ID. Note
You can call the DescribeProcessList operation to query the IDs of queries that are being executed. |
202105271604431720161662490345******* |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
22D6DEF0-CBC7-4388-A41C-D5FD62****** |
| StageList |
array<object> |
The execution plan broken down by stage. |
|
|
object |
|||
| State |
string |
The final execution state of the stage. Valid values:
|
FINISHED |
| CPUTimeAvg |
integer |
The average |
5984 |
| CPUTimeMax |
integer |
The maximum |
5984 |
| OperatorCost |
integer |
The total CPU time consumed by all operators in the stage, which is equivalent to the total CPU time of the stage. You can use this parameter to identify which parts of the stage consume the most computing resources. Unit: milliseconds. |
5984 |
| ScanTimeMax |
integer |
The maximum time consumed by a scan operator to read data on each storage node in the stage. Unit: milliseconds. |
0 |
| InputSizeMax |
integer |
The maximum input data size on each compute node in the stage. Unit: byte. |
173 |
| StageId |
integer |
The stage ID. |
1 |
| ScanSizeMax |
integer |
The maximum data size scanned by a scan operator on each storage node in the stage. Unit: bytes. |
0 |
| CPUTimeMin |
integer |
The minimum |
47 |
| ScanTimeMin |
integer |
The minimum time consumed by a scan operator to read data on each storage node in the stage. Unit: milliseconds. |
0 |
| ScanSizeMin |
integer |
The minimum data size scanned by a scan operator on each storage node in the stage. Unit: bytes. |
0 |
| InputSizeMin |
integer |
The minimum input data size on each compute node in the stage. Unit: bytes. |
173 |
| PeakMemory |
integer |
The peak memory usage during SQL statement execution. Unit: bytes. |
74208 |
| ScanTimeAvg |
integer |
The average time consumed by a scan operator to read data on each storage node in the stage. Unit: milliseconds. |
0 |
| ScanSizeAvg |
integer |
The average data size scanned by a scan operator on each storage node in the stage. Unit: bytes. |
0 |
| InputSizeAvg |
integer |
The average input data size on each compute node in the stage. Unit: bytes. |
173 |
| OriginInfo |
string |
The raw metadata of the SQL statement. |
{\"queryId\":\"20210527_160443_10581_hdhzr\",\"session\":{\"queryId\":\"20210527_160443_10581_hdhzr\",\"hasSharedStage\":false,\"parentId\":0}} |
| Detail |
object |
The execution details of the SQL statement. |
|
| SQL |
string |
The SQL statement. |
INSERT OVERWRITE INTO hdfs_import_external\nSELECT *\nFROM adb_hdfs_import_source |
| OutputSize |
integer |
The total output data size of the SQL statement. Unit: bytes. |
9 |
| State |
string |
The final execution state of the SQL statement. Valid values:
|
FINISHED |
| OutputRows |
integer |
The total number of output rows of the SQL statement. |
1 |
| User |
string |
The username that submitted the SQL statement. |
test_acc |
| StartTime |
string |
The execution start time of the SQL statement, in UNIX timestamp format (milliseconds since January 1, 1970, 00:00:00 UTC). |
1622102683243 |
| TotalStage |
integer |
The total number of stages in the SQL statement. |
4 |
| QueuedTime |
integer |
The time the SQL statement spent in the queue. Unit: milliseconds. |
0 |
| TotalTime |
integer |
The total execution time of the SQL statement. Unit: milliseconds. |
2340 |
| TotalTask |
integer |
The total number of tasks in the SQL statement. |
4 |
| Database |
string |
The database on which the SQL statement was executed. |
adb_demo |
| PeakMemory |
integer |
The peak memory usage during SQL statement execution. Unit: bytes. |
441802 |
| ClientIP |
string |
The client IP address used to execute the SQL statement. |
172.16.***.*** |
| PlanningTime |
integer |
The time spent generating the execution plan for the SQL statement. Unit: milliseconds. |
86 |
| CPUTime |
integer |
The total CPU time consumed by all operators across multithreaded servers during SQL statement execution. Unit: milliseconds. |
6100 |
Examples
Success response
JSON format
{
"RequestId": "22D6DEF0-CBC7-4388-A41C-D5FD62******",
"StageList": [
{
"State": "FINISHED",
"CPUTimeAvg": 5984,
"CPUTimeMax": 5984,
"OperatorCost": 5984,
"ScanTimeMax": 0,
"InputSizeMax": 173,
"StageId": 1,
"ScanSizeMax": 0,
"CPUTimeMin": 47,
"ScanTimeMin": 0,
"ScanSizeMin": 0,
"InputSizeMin": 173,
"PeakMemory": 74208,
"ScanTimeAvg": 0,
"ScanSizeAvg": 0,
"InputSizeAvg": 173
}
],
"OriginInfo": "{\\\"queryId\\\":\\\"20210527_160443_10581_hdhzr\\\",\\\"session\\\":{\\\"queryId\\\":\\\"20210527_160443_10581_hdhzr\\\",\\\"hasSharedStage\\\":false,\\\"parentId\\\":0}}",
"Detail": {
"SQL": "INSERT OVERWRITE INTO hdfs_import_external\\nSELECT *\\nFROM adb_hdfs_import_source",
"OutputSize": 9,
"State": "FINISHED",
"OutputRows": 1,
"User": "test_acc",
"StartTime": "1622102683243",
"TotalStage": 4,
"QueuedTime": 0,
"TotalTime": 2340,
"TotalTask": 4,
"Database": "adb_demo",
"PeakMemory": 441802,
"ClientIP": "172.16.***.***",
"PlanningTime": 86,
"CPUTime": 6100
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 404 | InvalidDBCluster.NotFound | The DBClusterId provided does not exist in our records. | The specified DBClusterId parameter does not exist. Make sure that the DBClusterId value is valid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.