Queries SQL patterns for an AnalyticDB for MySQL cluster within a specified time range.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
adb:DescribeSqlPattern |
get |
DBCluster
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| StartTime |
string |
Yes |
The query start date, in yyyy-MM-dd format (UTC). Note
Only data within the last 30 days can be queried. |
2021-08-30 |
| Order |
string |
No |
The sort order for query results. Specify as a JSON string, such as
Note
|
[{"Field":"Pattern","Type":"Asc"}] |
| PageNumber |
integer |
No |
The page number, starting from 1. Default value: 1. |
1 |
| SqlPattern |
string |
No |
The keyword to filter SQL patterns. Note
If not specified, all SQL patterns for the cluster within the time period specified by |
SELECT |
| Type |
string |
No |
The dimension by which to aggregate the SQL patterns. Valid values:
Note
If not specified, SQL patterns are aggregated by |
user |
| DBClusterId |
string |
Yes |
The cluster ID. Note
You can call the DescribeDBClusters operation to query AnalyticDB for MySQL clusters within a region, including cluster IDs. |
am-bp1r053byu48p**** |
| PageSize |
integer |
No |
The number of entries per page. Must be a positive integer. Default value: 30. |
30 |
| 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 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| PageSize |
integer |
The number of entries per page. |
30 |
| PageNumber |
integer |
The page number. |
1 |
| TotalCount |
integer |
The total number of entries returned. |
1 |
| Items |
array<object> |
The queried SQL pattern. |
|
|
object |
|||
| AvgStageCount |
string |
The average number of stages. |
2 |
| MaxCpuTime |
string |
The maximum execution duration of the SQL pattern within the specified time range. Unit: milliseconds. |
17 |
| AccessIP |
string |
The IP address of the client. Note
This parameter is returned only when |
100.104.***.*** |
| AvgScanSize |
string |
The average data scanned for the SQL pattern within the query time range. Unit: KB. |
0 |
| MaxScanSize |
string |
The maximum data scanned for the SQL pattern within the query time range. Unit: KB. |
0 |
| MaxPeakMemory |
string |
The maximum peak memory usage of the SQL pattern within the query time range. Unit: KB. |
480096 |
| AvgCpuTime |
string |
The average execution duration of the SQL pattern within the specified time range. Unit: milliseconds. |
1.0625 |
| User |
string |
The username. Note
This parameter is returned only when |
test_acc |
| AvgPeakMemory |
string |
The average peak memory usage of the SQL pattern within the query time range. Unit: KB. |
240048 |
| MaxStageCount |
string |
The maximum number of stages. |
2 |
| MaxTaskCount |
string |
The maximum number of tasks. |
2 |
| InstanceName |
string |
The cluster ID. |
am-bp1r053byu48p**** |
| QueryCount |
string |
The number of queries for the SQL pattern within the query time range. |
16 |
| ReportDate |
string |
The start date of the query. |
2021-08-30 |
| Pattern |
string |
The SQL pattern. |
SELECT table_name, table_schema AS schema_name, create_time, create_time AS last_ddl_time, table_comment AS description , ceil((data_length + index_length) / ? / ?) AS store_capacity , data_length AS data_bytes, index_length AS index_bytes, table_collation AS collation, auto_increment, table_rows AS num_rows , engine FROM information_schema.tables WHERE table_type != ? AND table_schema = ? AND table_name IN (?) ORDER BY 1 |
| AvgTaskCount |
string |
The average number of tasks. |
2 |
| RequestId |
string |
The request ID. |
B6F2D1B4-2C9F-5622-B424-5E7965****** |
Examples
Success response
JSON format
{
"PageSize": 30,
"PageNumber": 1,
"TotalCount": 1,
"Items": [
{
"AvgStageCount": "2",
"MaxCpuTime": "17",
"AccessIP": "100.104.***.***",
"AvgScanSize": "0",
"MaxScanSize": "0",
"MaxPeakMemory": "480096",
"AvgCpuTime": "1.0625",
"User": "test_acc",
"AvgPeakMemory": "240048",
"MaxStageCount": "2",
"MaxTaskCount": "2",
"InstanceName": "am-bp1r053byu48p****",
"QueryCount": "16",
"ReportDate": "2021-08-30",
"Pattern": "SELECT table_name, table_schema AS schema_name, create_time, create_time AS last_ddl_time, table_comment AS description , ceil((data_length + index_length) / ? / ?) AS store_capacity , data_length AS data_bytes, index_length AS index_bytes, table_collation AS collation, auto_increment, table_rows AS num_rows , engine FROM information_schema.tables WHERE table_type != ? AND table_schema = ? AND table_name IN (?) ORDER BY 1",
"AvgTaskCount": "2"
}
],
"RequestId": "B6F2D1B4-2C9F-5622-B424-5E7965******"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.