All Products
Search
Document Center

AnalyticDB:DescribeDiagnosisSQLInfo

最終更新日:Jul 30, 2024

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

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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:
    • The required resource types are displayed in bold characters.
    • 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:DescribeDiagnosisSQLInfoget
  • DBCluster
    acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBClusterIdstringYes

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****
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 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******
ProcessStartTimelongYes

The execution start time of the SQL statement. Specify the time in the 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
ProcessStatestringYes

The state of the SQL statement. Valid values:

  • running

  • finished

  • failed

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
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 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 parameters

ParameterTypeDescriptionExample
object
DiagnosisSQLInfostring

Execution details of the SQL statement, including the SQL 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 } }
RequestIdstring

The ID of the request.

1
StageInfosarray<object>

Execution details of the query by stage.

object
InputRowslong

The total number of input rows in the stage.

123
InputDataSizelong

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

2341
OutputRowslong

The total number of output rows in the stage.

231
OutputDataSizelong

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

12344
PeakMemorylong

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

3421
OperatorCostlong

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

2341
StageIdstring

The ID of the stage.

Stage[26]
Statestring

The state of the stage.

Enumeration Value:
  • FAILED: FAILED.
  • RUNNING: RUNNING.
  • FINISHED: FINISHED.
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": 123,
      "InputDataSize": 2341,
      "OutputRows": 231,
      "OutputDataSize": 12344,
      "PeakMemory": 3421,
      "OperatorCost": 2341,
      "StageId": "Stage[26]",
      "State": "RUNNING",
      "Progress": 0.3
    }
  ]
}

Error codes

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

Change history

Change timeSummary of changesOperation
2023-08-31The internal configuration of the API is changed, but the call is not affectedView Change Details