Queries the diagnostic information about SQL statements that meet a condition in an AnalyticDB for MySQL cluster.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
adb:DescribeDiagnosisRecords | get |
|
| 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-bp1r053byu48p**** |
StartTime | string | Yes | The beginning of the time range to query. Specify a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. Note
Only data within the last 14 days can be queried.
| 1632931200000 |
EndTime | string | Yes | The end of the time range to query. Specify a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. Note
| 1633017540000 |
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 |
QueryCondition | string | Yes | The query condition for SQL statements, which can contain the
| {"Type":"status","Value":"finished"} |
Keyword | string | No | The keyword for the query. | select |
MinPeakMemory | long | No | The minimum peak memory of the SQL statements. Unit: bytes. | 0 |
MaxPeakMemory | long | No | The maximum peak memory of the SQL statements. Unit: bytes. | 89000000 |
MinScanSize | long | No | The minimum scan size of the SQL statements. Unit: bytes. | 0 |
MaxScanSize | long | No | The maximum scan size of the SQL statements. Unit: bytes. | 104428198 |
ResourceGroup | string | No | The resource group to which the SQL statements belong. Note
You can call the DescribeDiagnosisDimensions operation to query the resource group, database name, username, and source IP address of the SQL statements to be queried.
| user_default |
UserName | string | No | The username that is used to execute the SQL statements. Note
You can call the DescribeDiagnosisDimensions operation to query the resource group, database name, username, and source IP address of the SQL statements to be queried.
| test_user |
Database | string | No | The database on which the SQL statements are executed. Note
You can call the DescribeDiagnosisDimensions operation to query the resource group, database name, username, and source IP address of the SQL statements to be queried.
| adb_demo |
ClientIp | string | No | The source IP address. Note
You can call the DescribeDiagnosisDimensions operation to query the resource group, database name, username, and source IP address of the SQL statements to be queried.
| 59.82.xx.xx |
Order | string | No | The order in which to sort the retrieved SQL statements by field. Specify this value in the JSON format. The value is an ordered array that uses the order of the input array and contains the
| [{"Field":"StartTime", "Type": "desc" }] |
PageNumber | integer | No | The page number. Pages start from page 1. Default value: 1. | 1 |
PageSize | integer | No | The number of entries per page. Valid values: 30, 50, and 100. Default value: 30. | 30 |
Lang | string | No | The language of file titles and error messages. Valid values:
| zh |
PatternId | string | No | The SQL pattern ID. Note
You can call the DescribeSQLPatterns operation to query the information about all SQL patterns within an AnalyticDB for MySQL cluster in a time range, including SQL pattern IDs.
| 5575924945138****** |
Response parameters
Examples
Sample success responses
JSON
format
{
"PageNumber": 1,
"PageSize": 30,
"TotalCount": 1,
"Querys": [
{
"SQL": "SELECT count(*)\\nFROM nation",
"SQLTruncatedThreshold": 5120,
"Status": "finished",
"OutputDataSize": 9,
"Cost": 10,
"OutputRows": 1,
"RcHost": "10.0.xx.xx:3004",
"ScanSize": 9,
"ProcessId": "2021093000414401000000023503151******",
"StartTime": 1632933704000,
"SQLTruncated": false,
"Database": "adb_demo",
"ScanRows": 1,
"ResourceCostRank": 1,
"ClientIp": "59.82.xx.xx",
"PeakMemory": 16648,
"QueueTime": 0,
"ResourceGroup": "user_default",
"UserName": "test_user",
"ExecutionTime": 6,
"TotalPlanningTime": 4,
"EtlWriteRows": 0,
"TotalStages": 2
}
],
"RequestId": "109462AF-B5FA-3D5A-9377-B27E5B******"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-01-05 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2021-10-12 | The response structure of the API has changed | View Change Details |
2021-10-12 | The request parameters of the API has changed | View Change Details |