You can call this operation to query the basic information of an executed SQL statement and the information of a plan.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer automatically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeSQLPlan

The operation that you want to perform. Set the value to DescribeSQLPlan.

DBClusterId String Yes am-bpxxxxxxxx47

The ID of the cluster.

ProcessId String Yes 201907241445291720211111570315107****

The ID of the task.

Response parameters

Parameter Type Example Description
Detail Struct

The details of the executed SQL statement.

CPUTime Long 35

The total CPU time consumed by operators in the query or the extract-transform-load (ETL) task, which is equivalent to the total time consumed by the logic of operators. Unit: milliseconds.

ClientIP String 0.0.0.0

The IP address of the client that is used to submit the query.

Database String information_schema

The name of the database to which you are connected.

OutputRows Long 395

The total number of output rows in the task.

OutputSize Long 3553

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

PeakMemory Long 2099901

The peak memory of the query or the ETL task. Unit: bytes.

PlanningTime Long 5

The optimization time consumed by the query or the ETL task. Unit: milliseconds.

QueuedTime Long 0

The amount of time that the query or the ETL task spends in the queue. Unit: milliseconds.

SQL String SELECT count(*)\nFROM COLUMNS\nGROUP BY COLUMN_NAME

The SQL statement.

StartTime String 1598613625178

The start time of the query or the ETL task.

State String FINISHED

The final execution status of the query or the ETL task. Valid values:

  • FINISHED
  • FAILED
TotalStage Long 3

The total number of stages.

TotalTask Long 6

The total number of tasks.

TotalTime Long 35

The total time consumed to complete the query or ETL task. Unit: milliseconds.

User String kepler

The name of the user that submits the query.

OriginInfo String \"queryId\":\"20200828_192025_834_tvyaw\",\"session\":{\"queryId\":\"20200828_192025_834_tvyaw\",\"tstcMin\":0}\"parentId\":0}

The original details of the SQL statement.

RequestId String 1AD222E9-E606-4A42-BF6D-8A4442913CEF

The ID of the request.

StageList Array of SqlPlanStage

The list of stages.

CPUTimeAvg Long 4

The average CPU time consumed on each compute node in the stage. Unit: milliseconds.

CPUTimeMax Long 4

The maximum CPU time consumed on each node in the stage. Unit: milliseconds.

CPUTimeMin Long 4

The minimum CPU time consumed on each node in the stage. Unit: milliseconds.

InputSizeAvg Long 0

The average amount of input data on each compute node in the stage. Unit: bytes.

InputSizeMax Long 0

The maximum amount of input data on each compute node in the stage. Unit: bytes.

InputSizeMin Long 0

The minimum amount of input data on each compute node in the stage. Unit: bytes.

OperatorCost Long 4

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 determine which parts of the stage consume a large amount of computing resources. Unit: milliseconds.

PeakMemory Long 141700

The peak memory of the stage. You can use this parameter to determine which parts of the stage consume a large amount of memory resources. Unit: bytes.

ScanSizeAvg Long 0

The average amount of data on each storage node, which is scanned from a data source in the stage. Unit: bytes.

ScanSizeMax Long 0

The maximum amount of data on each storage node, which is scanned from a data source in the stage. Unit: bytes.

ScanSizeMin Long 0

The minimum amount of data on each storage node, which is scanned from a data source in the stage. Unit: bytes.

ScanTimeAvg Long 2

The average time consumed by each storage node to scan data from a data source in the stage. Unit: milliseconds.

ScanTimeMax Long 2

The maximum time consumed by each storage node to scan data from a data source in the stage. Unit: milliseconds.

ScanTimeMin Long 2

The minimum time consumed by each storage node to scan data from a data source in the stage. Unit: milliseconds.

StageId Integer 2

The ID of the stage.

State String FINISHED

The final execution status of the stage. Valid values:

  • FINISHED
  • CANCELED
  • ABORTED
  • FAILED

Examples

Sample requests

http(s)://[Endpoint]/? Action=DescribeSQLPlan
&DBClusterId=am-bpxxxxxxxx47
&ProcessId=201907241445291720211111570315107****
&<Common request parameters>

Sample success responses

XML format

<RequestId>1AD222E9-E606-4A42-BF6D-8A4442913CEF</RequestId>
<StageList>
    <ScanSizeAvg>0</ScanSizeAvg>
    <ScanSizeMin>0</ScanSizeMin>
    <PeakMemory>141700</PeakMemory>
    <StageId>2</StageId>
    <CPUTimeMax>4</CPUTimeMax>
    <ScanTimeAvg>2</ScanTimeAvg>
    <ScanTimeMin>2</ScanTimeMin>
    <InputSizeMax>0</InputSizeMax>
    <ScanSizeMax>0</ScanSizeMax>
    <InputSizeAvg>0</InputSizeAvg>
    <InputSizeMin>0</InputSizeMin>
    <State>FINISHED</State>
    <ScanTimeMax>2</ScanTimeMax>
    <OperatorCost>4</OperatorCost>
    <CPUTimeAvg>4</CPUTimeAvg>
    <CPUTimeMin>4</CPUTimeMin>
</StageList>
<OriginInfo>\"queryId\":\"20200828_192025_834_tvyaw\",\"session\":{\"queryId\":\"20200828_192025_834_tvyaw\",\"tstcMin\":0}\"parentId\":0}</OriginInfo>
<Detail>
    <TotalTask>6</TotalTask>
    <OutputSize>3553</OutputSize>
    <User>kepler</User>
    <PeakMemory>2099901</PeakMemory>
    <TotalStage>3</TotalStage>
    <StartTime>1598613625178</StartTime>
    <ClientIP>0.0.0.0</ClientIP>
    <CPUTime>35</CPUTime>
    <SQL>SELECT count(*)\nFROM COLUMNS\nGROUP BY COLUMN_NAME</SQL>
    <QueuedTime>0</QueuedTime>
    <State>FINISHED</State>
    <PlanningTime>5</PlanningTime>
    <TotalTime>35</TotalTime>
    <Database>information_schema</Database>
    <OutputRows>395</OutputRows>
</Detail>

JSON format

{
    "RequestId": "1AD222E9-E606-4A42-BF6D-8A4442913CEF",
    "StageList": {
        "ScanSizeAvg": 0,
        "ScanSizeMin": 0,
        "PeakMemory": 141700,
        "StageId": 2,
        "CPUTimeMax": 4,
        "ScanTimeAvg": 2,
        "ScanTimeMin": 2,
        "InputSizeMax": 0,
        "ScanSizeMax": 0,
        "InputSizeAvg": 0,
        "InputSizeMin": 0,
        "State": "FINISHED",
        "ScanTimeMax": 2,
        "OperatorCost": 4,
        "CPUTimeAvg": 4,
        "CPUTimeMin": 4
    },
    "OriginInfo": "\\\"queryId\\\":\\\"20200828_192025_834_tvyaw\\\",\\\"session\\\":{\\\"queryId\\\":\\\"20200828_192025_834_tvyaw\\\",\\\"tstcMin\\\":0}\\\"parentId\\\":0}",
    "Detail": {
        "TotalTask": 6,
        "OutputSize": 3553,
        "User": "kepler",
        "PeakMemory": 2099901,
        "TotalStage": 3,
        "StartTime": 1598613625178,
        "ClientIP": "0.0.0.0",
        "CPUTime": 35,
        "SQL": "SELECT count(*)\\nFROM COLUMNS\\nGROUP BY COLUMN_NAME",
        "QueuedTime": 0,
        "State": "FINISHED",
        "PlanningTime": 5,
        "TotalTime": 35,
        "Database": "information_schema",
        "OutputRows": 395
    }
}

Error codes

HttpCode Error code Error message Description
404 InvalidDBCluster.NotFound The DBClusterId provided does not exist in our records. The error message returned because the specified DBClusterId parameter does not exist. Check whether you specify the DBClusterId parameter correctly.

For a list of error codes, visit the API Error Center.