DescribeSQLPatterns
Queries the list of SQL patterns for an AnalyticDB for MySQL Data Lakehouse Edition cluster within a specified date range.
Operation description
The public endpoint for the center:
adb.aliyuncs.com.The public endpoint for a region:
adb.<region-id>.aliyuncs.com. Example:adb.cn-hangzhou.aliyuncs.com.The VPC endpoint for a region:
adb-vpc.<region-id>.aliyuncs.com. Example: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 operation to query the details of all AnalyticDB for MySQL Data Lakehouse Edition clusters in a specified region, including the cluster IDs. |
amv-8vb8de93v9b**** |
| StartTime |
string |
No |
The start time of the query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Note
|
2022-09-06T03:06:00Z |
| EndTime |
string |
No |
The end time of the query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Note
The end time must be later than the start time. |
2022-09-07T03:06:00Z |
| RegionId |
string |
Yes |
The region ID. |
cn-hangzhou |
| Keyword |
string |
No |
The search keyword. |
SELECT |
| Order |
string |
No |
The sorting configuration for the query results. The value is a JSON string. Example:
|
[{"Field":"AverageQueryTime","Type":"Asc"}] |
| PageNumber |
integer |
No |
The page number. Valid values: positive integers up to the maximum value of the Integer data type. Default value: 1. |
2 |
| PageSize |
integer |
No |
The number of entries per page. Valid values:
|
10 |
| Lang |
string |
No |
The language configuration. Valid values:
|
zh |
| UserName |
string |
No |
The name of the database account that executes the SQL statement. |
test_user |
| SqlPatternHash |
integer |
No |
The hash value of the SQL pattern, which is used to filter specific SQL patterns. |
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> |
The list. |
|
|
object |
The details of the SQL pattern. |
||
| SQLPattern |
string |
The SQL pattern statement. |
SELECT * FROM KEPLER_META_NODE_STATIC_INFO WHERE elastic_node = ? OR (elastic_node = ? AND enable = ?) |
| PatternId |
string |
The ID of the SQL pattern statement. |
5575924945138****** |
| User |
string |
The name of the database user that submitted the SQL statement related to the pattern. |
test |
| AccessIp |
string |
The IP address of the client that submitted the SQL statement related to the pattern. |
192.168.xx.xx |
| Tables |
string |
The list of tables scanned by the SQL pattern. |
tpch.orders |
| PatternCreationTime |
string |
The earliest submission time of the pattern within the specified time range. |
2022-09-06 05:06:00 |
| AverageQueryTime |
number |
The average total duration of the pattern within the specified time range. Unit: milliseconds. |
4 |
| MaxQueryTime |
integer |
The maximum total duration of the pattern within the specified time range. Unit: milliseconds. |
2341 |
| AverageExecutionTime |
number |
The average execution duration of the pattern within the specified time range. Unit: milliseconds. |
234.78 |
| MaxExecutionTime |
integer |
The maximum execution duration of the pattern within the specified time range. Unit: milliseconds. |
2142 |
| AveragePeakMemory |
number |
The average peak memory usage of the pattern within the specified time range. Unit: bytes. |
234.22 |
| MaxPeakMemory |
integer |
The maximum peak memory for the SQL statement related to the pattern. Unit: bytes. |
234149 |
| AverageScanSize |
number |
The average amount of data read by the pattern within the specified time range. Unit: bytes. |
234149.23 |
| MaxScanSize |
integer |
The maximum amount of data read by the SQL statement related to the pattern. Unit: bytes. |
32212254 |
| QueryCount |
integer |
The number of executions of the pattern within the specified time range. |
345 |
| FailedCount |
integer |
The number of failures of the pattern within the specified time range. |
18 |
| Blockable |
boolean |
Specifies whether the execution of the current SQL pattern can be blocked. Valid values:
Note
Currently, AnalyticDB for MySQL only supports blocking SELECT and INSERT statements. |
true |
| QueryTimeSum |
number |
The total duration. Unit: milliseconds. |
5 |
| QueryTimePercentage |
number |
The percentage of the total duration of a single pattern within the query time range out of the total duration of all patterns. Unit: %. |
10 |
| PeakMemorySum |
number |
The total peak memory usage. Unit: bytes. |
5 |
| PeakMemoryPercentage |
number |
The percentage of the total peak memory usage of a single pattern within the query time range out of the total peak memory usage of all patterns. Unit: %. |
10 |
| ScanSizeSum |
number |
The total amount of scanned data. Unit: bytes. |
5 |
| ScanSizePercentage |
number |
The percentage of the total amount of data scanned by a single pattern within the query time range out of the total amount of data scanned by all patterns. Unit: %. |
80 |
| AverageOperatorCost |
number |
The average CPU cost. Unit: milliseconds. |
5 |
| MaxOperatorCost |
number |
The maximum CPU cost. Unit: milliseconds. |
5 |
| OperatorCostSum |
number |
The total CPU cost. Unit: milliseconds. |
5 |
| OperatorCostPercentage |
number |
The percentage of the total CPU cost. Unit: %. |
20 |
| AverageScanCost |
number |
The average scan duration. |
5 |
| MaxScanCost |
number |
The maximum scan duration. |
5 |
| ScanCostSum |
number |
The total data scan cost. Unit: milliseconds. |
5 |
| ScanCostPercentage |
number |
The percentage of the total data scan cost. Unit: %. |
5 |
| RequestId |
string |
The request ID. |
F3174013-5B7A-5A47-9FE0-6B5D397BD86A |
| AccessDeniedDetail |
string |
The details of the access denial. This field is returned only when the 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.