DescribeSQLPatterns
View the list of SQL patterns for an AnalyticDB for MySQL Data Lakehouse Edition cluster for a specified date range.
Operation description
Global public endpoint:
adb.aliyuncs.com.Regional public endpoint:
adb.<region-id>.aliyuncs.com(e.g.,adb.cn-hangzhou.aliyuncs.com).Regional VPC endpoint:
adb-vpc.<region-id>.aliyuncs.com(e.g.,adb-vpc.cn-hangzhou.aliyuncs.com).
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
adb:DescribeSQLPatterns |
list |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBClusterId |
string |
Yes |
The ID of the AnalyticDB for MySQL (Data Lakehouse Edition) cluster. Note
You can call the DescribeDBClusters API to find the cluster IDs of all AnalyticDB for MySQL (Data Lakehouse Edition) clusters in a specific region. |
amv-8vb8de93v9b**** |
| StartTime |
string |
No |
The start of the time range to query. The time must be in UTC and formatted as yyyy-MM-ddTHH:mm:ssZ. Note
|
2022-09-06T03:06:00Z |
| EndTime |
string |
No |
The end of the time range to query. The time must be in UTC and formatted as yyyy-MM-ddTHH:mm:ssZ. Note
The end time must be later than the start time. |
2022-09-07T03:06:00Z |
| RegionId |
string |
Yes |
The ID of the region. |
cn-hangzhou |
| Keyword |
string |
No |
The keyword for filtering the query results. |
SELECT |
| Order |
string |
No |
The sort order for the results. Specify this parameter as a JSON string, for example,
|
[{"Field":"AverageQueryTime","Type":"Asc"}] |
| PageNumber |
integer |
No |
The page number. Must be an integer greater than 0. Default: 1. |
2 |
| PageSize |
integer |
No |
The number of entries per page. Valid values:
|
10 |
| Lang |
string |
No |
The response language. Valid values:
|
zh |
| UserName |
string |
No |
The username of the database account used to execute the SQL statements. |
test_user |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The details of the SQL patterns. |
||
| PageNumber |
integer |
The page number. |
2 |
| PageSize |
integer |
The number of entries per page. |
10 |
| TotalCount |
integer |
The total number of entries. |
20 |
| PatternDetails |
array<object> |
A list of SQL patterns. |
|
|
object |
The details of the SQL pattern. |
||
| SQLPattern |
string |
The SQL pattern. |
SELECT * FROM KEPLER_META_NODE_STATIC_INFO WHERE elastic_node = ? OR (elastic_node = ? AND enable = ?) |
| PatternId |
string |
The ID of the SQL pattern. |
5575924945138****** |
| User |
string |
The name of the database user who submitted the matching SQL statements. |
test |
| AccessIp |
string |
The client IP address used to submit the queries. |
192.168.xx.xx |
| Tables |
string |
The tables scanned by the SQL pattern. |
tpch.orders |
| PatternCreationTime |
string |
The submission time of the first query that matches this pattern within the specified time range. |
2022-09-06 05:06:00 |
| AverageQueryTime |
number |
The average duration of queries matching this pattern. Unit: milliseconds. |
4 |
| MaxQueryTime |
integer |
The maximum duration of a query matching this pattern. Unit: milliseconds. |
2341 |
| AverageExecutionTime |
number |
The average execution time of queries matching this pattern. Unit: milliseconds. |
234.78 |
| MaxExecutionTime |
integer |
The maximum execution time of a query matching this pattern. Unit: milliseconds. |
2142 |
| AveragePeakMemory |
number |
The average peak memory usage of queries matching this pattern. Unit: bytes. |
234.22 |
| MaxPeakMemory |
integer |
The maximum peak memory usage of a query matching this pattern. Unit: bytes. |
234149 |
| AverageScanSize |
number |
The average amount of data scanned by queries matching this pattern. Unit: bytes. |
234149.23 |
| MaxScanSize |
integer |
The maximum amount of data scanned by a query matching this pattern. Unit: bytes. |
32212254 |
| QueryCount |
integer |
The number of executed queries that match this pattern. |
345 |
| FailedCount |
integer |
The number of failed queries that match this pattern. |
18 |
| Blockable |
boolean |
Indicates whether queries that match this pattern can be blocked. Valid values:
Note
Currently, AnalyticDB for MySQL allows you to block only SELECT and INSERT statements. |
true |
| QueryTimeSum |
number |
The total query duration for all queries that match this pattern. Unit: milliseconds. |
5 |
| QueryTimePercentage |
number |
The total query time of queries matching this pattern as a percentage of the total query time for all queries. Unit: %. |
10 |
| PeakMemorySum |
number |
The sum of the peak memory usage for all queries that match this pattern. Unit: bytes. |
5 |
| PeakMemoryPercentage |
number |
The total peak memory usage of queries matching this pattern as a percentage of the total peak memory usage for all queries. Unit: %. |
10 |
| ScanSizeSum |
number |
The total amount of data scanned by all queries that match this pattern. Unit: bytes. |
5 |
| ScanSizePercentage |
number |
The total amount of data scanned by queries matching this pattern as a percentage of the total data scanned by all queries. Unit: %. |
80 |
| AverageOperatorCost |
number |
The average CPU cost for queries that match this pattern. Unit: milliseconds. |
5 |
| MaxOperatorCost |
number |
The maximum CPU cost for a query that matches this pattern. Unit: milliseconds. |
5 |
| OperatorCostSum |
number |
The total CPU cost for all queries that match this pattern. Unit: milliseconds. |
5 |
| OperatorCostPercentage |
number |
The total CPU cost of queries matching this pattern as a percentage of the total CPU cost for all queries. Unit: %. |
20 |
| AverageScanCost |
number |
The average scan time for queries that match this pattern. Unit: milliseconds. |
5 |
| MaxScanCost |
number |
The maximum scan time for a query that matches this pattern. Unit: milliseconds. |
5 |
| ScanCostSum |
number |
The total scan cost for all queries that match this pattern. Unit: milliseconds. |
5 |
| ScanCostPercentage |
number |
The total scan cost of queries matching this pattern as a percentage of the total scan cost for all queries. Unit: %. |
5 |
| RequestId |
string |
The request ID. |
F3174013-5B7A-5A47-9FE0-6B5D397BD86A |
| AccessDeniedDetail |
string |
Details about the access denial. This parameter is returned only if RAM authentication fails. |
{ "PolicyType": "AccountLevelIdentityBasedPolicy", "AuthPrincipalOwnerId": "1*****************7", "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcKwyhk62IeYly4hQ+5IpXjkh1GQXuDRCQ==", "AuthPrincipalType": "SubUser", "AuthPrincipalDisplayName": "2***************9", "NoPermissionType": "ImplicitDeny", "AuthAction": "adb:DescribeExcessivePrimaryKeys" } |
Examples
Success response
JSON format
{
"PageNumber": 2,
"PageSize": 10,
"TotalCount": 20,
"PatternDetails": [
{
"SQLPattern": "SELECT * FROM KEPLER_META_NODE_STATIC_INFO WHERE elastic_node = ? OR (elastic_node = ? AND enable = ?)",
"PatternId": "5575924945138******",
"User": "test",
"AccessIp": "192.168.xx.xx",
"Tables": "tpch.orders",
"PatternCreationTime": "2022-09-06 05:06:00",
"AverageQueryTime": 4,
"MaxQueryTime": 2341,
"AverageExecutionTime": 234.78,
"MaxExecutionTime": 2142,
"AveragePeakMemory": 234.22,
"MaxPeakMemory": 234149,
"AverageScanSize": 234149.23,
"MaxScanSize": 32212254,
"QueryCount": 345,
"FailedCount": 18,
"Blockable": true,
"QueryTimeSum": 5,
"QueryTimePercentage": 10,
"PeakMemorySum": 5,
"PeakMemoryPercentage": 10,
"ScanSizeSum": 5,
"ScanSizePercentage": 80,
"AverageOperatorCost": 5,
"MaxOperatorCost": 5,
"OperatorCostSum": 5,
"OperatorCostPercentage": 20,
"AverageScanCost": 5,
"MaxScanCost": 5,
"ScanCostSum": 5,
"ScanCostPercentage": 5
}
],
"RequestId": "F3174013-5B7A-5A47-9FE0-6B5D397BD86A",
"AccessDeniedDetail": "{\n \"PolicyType\": \"AccountLevelIdentityBasedPolicy\",\n \"AuthPrincipalOwnerId\": \"1*****************7\",\n \"EncodedDiagnosticMessage\": \"AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcKwyhk62IeYly4hQ+5IpXjkh1GQXuDRCQ==\",\n \"AuthPrincipalType\": \"SubUser\",\n \"AuthPrincipalDisplayName\": \"2***************9\",\n \"NoPermissionType\": \"ImplicitDeny\",\n \"AuthAction\": \"adb:DescribeExcessivePrimaryKeys\"\n}"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.