Queries the summary of SQL statements that meet specified conditions in an AnalyticDB for MySQL cluster.
Operation description
For information about service endpoints, see Endpoints.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
adb:DescribeDiagnosisRecords |
list |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBClusterId |
string |
Yes |
The ID of the Enterprise Edition, Basic Edition, or Data Lakehouse Edition cluster. Note
Call the DescribeDBClusters operation to view the details of all clusters in your account, including cluster IDs. |
amv-bp1scs48yc125**** |
| StartTime |
string |
No |
The start of the time range to query. Specify the time in the UNIX timestamp format. The time must be in milliseconds. Note
Only data from the last 14 days can be queried. |
1632931200000 |
| EndTime |
string |
No |
The end of the time range to query. Specify the time in the UNIX timestamp format. The time must be in milliseconds. Note
|
1633017540000 |
| RegionId |
string |
Yes |
The region ID. Note
Call the DescribeRegions operation to view the regions and zones supported by AnalyticDB for MySQL, including region IDs. |
cn-hangzhou |
| QueryCondition |
string |
No |
The conditions for the SQL query. This parameter is a JSON string that contains fields such as Type,
|
{"Type":"status","Value":"finished"} |
| Keyword |
string |
No |
Filters the queries by the keywords contained in the SQL statements. |
select |
| MinPeakMemory |
integer |
No |
The minimum peak memory of the SQL statement. Unit: bytes. |
0 |
| MaxPeakMemory |
integer |
No |
The maximum peak memory of the SQL statement. Unit: bytes. |
89000000 |
| MinScanSize |
integer |
No |
The minimum scan size of the SQL statement. Unit: bytes. |
0 |
| MaxScanSize |
integer |
No |
The maximum scan size of the target SQL statement. Unit: bytes. |
1024000000 |
| ResourceGroup |
string |
No |
The resource group to which the SQL statement belongs. Note
Call the DescribeDiagnosisDimensions operation to view the resource groups, database names, usernames, and source IP addresses for the SQL statements that meet the specified query conditions. |
user_default |
| UserName |
string |
No |
The username used to execute the SQL statement. Call the DescribeDiagnosisDimensions operation to view the resource groups, database names, usernames, and source IP addresses for the SQL statements that meet the specified query conditions. |
test_user |
| Database |
string |
No |
The database where the SQL statement is executed. Note
Call the DescribeDiagnosisDimensions operation to view the resource groups, database names, usernames, and source IP addresses for the SQL statements that meet the specified query conditions. |
adb_demo |
| ClientIp |
string |
No |
The source IP address. Note
Call the DescribeDiagnosisDimensions operation to view the resource groups, database names, usernames, and source IP addresses for the SQL statements that meet the specified query conditions. |
59.82.XX.XX |
| Order |
string |
No |
The sorting order of the SQL statements. This parameter is a JSON array that is ordered by the sequence of the input array. It contains the
|
[{"Field":"StartTime", "Type": "desc" }] |
| PageNumber |
integer |
No |
The page number. The value must be an integer that is greater than 0. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page. Valid values:
|
30 |
| Lang |
string |
No |
The language of the file title and some error messages in the downloaded file. Valid values:
|
zh |
| PatternId |
string |
No |
The ID of the SQL pattern. |
5575924945138****** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| PageNumber |
integer |
The page number. The value is an integer that is greater than 0. Default value: 1. |
1 |
| PageSize |
integer |
The number of entries per page. Valid values:
|
30 |
| TotalCount |
integer |
The total number of entries. |
1 |
| Querys |
array<object> |
The list of SQL statement details. |
|
|
array<object> |
A list of queries. |
||
| SQL |
string |
The details of the SQL statement. Note
For performance, an SQL statement can be up to 5,120 characters long. Longer statements are truncated. Call the DownloadDiagnosisRecords operation to download the summary information of SQL statements that meet the specified conditions, including the complete SQL statements. |
SELECT count(*)\nFROM nation |
| SQLTruncatedThreshold |
integer |
The truncation threshold for the SQL statement. The value is fixed at 5,120 characters. SQL statements that exceed this limit are truncated. |
5120 |
| Status |
string |
The state of the SQL statement. Valid values:
|
finished |
| OutputDataSize |
integer |
The amount of returned data. Unit: bytes. |
9 |
| Cost |
integer |
The total execution duration of the query. Unit: milliseconds. Note
This duration is the sum of |
10 |
| OutputRows |
integer |
The number of returned rows. |
1 |
| RcHost |
string |
The IP address and port number of the AnalyticDB for MySQL frontend node that is used to execute the SQL statement. |
10.0.XX.XX:3004 |
| ScanSize |
integer |
The amount of scanned data. Unit: bytes. |
9 |
| ProcessId |
string |
The query ID. |
2021093000414401000000023503151****** |
| StartTime |
integer |
The start time of the SQL execution. This value is a UNIX timestamp. Unit: milliseconds. |
1632933704000 |
| SQLTruncated |
boolean |
Indicates whether the length of the query result exceeds the threshold. If the length exceeds the threshold, the query result is truncated. Valid values:
|
false |
| Database |
string |
The name of the database where the SQL statement is executed. |
adb_demo |
| ScanRows |
integer |
The number of scanned rows. |
1 |
| ResourceCostRank |
integer |
The ranking of the execution duration of an operator in the SQL statement. Note
This parameter is returned only for SQL statements that are in the |
1 |
| ClientIp |
string |
The source IP address. |
59.82.XX.XX |
| PeakMemory |
integer |
The peak memory. Unit: bytes. |
16648 |
| QueueTime |
integer |
The amount of time that the query waited in a queue before execution. Unit: milliseconds (ms). |
6 |
| ResourceGroup |
string |
The resource pool to which the SQL statement belongs. |
user_default |
| UserName |
string |
The username used to execute the SQL statement. |
test_user |
| ExecutionTime |
integer |
The execution duration of the query. Unit: milliseconds (ms). |
6 |
| TotalPlanningTime |
integer |
The amount of time that was required to generate the execution plan. Unit: milliseconds (ms). |
4 |
| EtlWriteRows |
integer |
The number of rows written to a table in an ETL task. |
0 |
| TotalStages |
integer |
The total number of stages generated for the query. |
2 |
| QueryProperties |
array<object> |
The list of properties that are in effect for the current query. Note
For a list of common properties, see Config and Hint configuration parameters. |
|
|
object |
The description of the property key-value pair. |
||
| Name |
string |
The property name. |
max_select_items_count |
| Value |
string |
The property value. |
1024 |
| PatternId |
string |
The ID of the SQL pattern. Note
Call the DescribePatternPerformance operation to view the detailed execution metrics of the SQL pattern within a specified time range. |
-5575924945138****** |
| RequestId |
string |
The request ID. |
7F88BEFA-CF0B-5C95-8BB1-92EC9F09E40D |
Examples
Success response
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": 6,
"ResourceGroup": "user_default",
"UserName": "test_user",
"ExecutionTime": 6,
"TotalPlanningTime": 4,
"EtlWriteRows": 0,
"TotalStages": 2,
"QueryProperties": [
{
"Name": "max_select_items_count",
"Value": "1024"
}
],
"PatternId": "-5575924945138******"
}
],
"RequestId": "7F88BEFA-CF0B-5C95-8BB1-92EC9F09E40D"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.