DescribeSqlPattern - 查询SQL模式
查看指定日期内AnalyticDB MySQL版集群下的SQL模板详情。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
adb:DescribeSqlPattern |
get |
DBCluster
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| StartTime |
string |
否 |
需要查询的日期,格式为yyyy-MM-dd(UTC 时间)。 说明
仅支持查看 30 天内的数据。 |
2021-08-30 |
| Order |
string |
否 |
将查询结果按指定字段进行排序。格式为 JSON 字符串,例如
说明
|
[{"Field":"Pattern","Type":"Asc"}] |
| PageNumber |
integer |
否 |
页码,取值为大于 0 且不超过 Integer 数据类型的最大值。默认值为 1。 |
1 |
| SqlPattern |
string |
否 |
需要包含的 SQL Pattern 的关键字。 说明
若该参数不填,默认返回目标集群在 |
SELECT |
| Type |
string |
否 |
按指定维度来聚合 SQL Pattern。支持如下取值:
说明
若该参数不填,默认按照 |
user |
| DBClusterId |
string |
是 |
集群 ID。 说明
您可以调用 DescribeDBClusters 接口查看目标地域下所有 AnalyticDB MySQL 集群的详情,包括集群 ID。 |
am-bp1r053byu48p**** |
| PageSize |
integer |
否 |
每页记录数,取值为任意正整数。默认为 30。 |
30 |
| RegionId |
string |
是 |
地域 ID。 说明
您可以调用 DescribeRegions 接口查看 AnalyticDB MySQL 版支持的地域和可用区信息,包括地域 ID。 |
cn-hangzhou |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
详情。 |
||
| PageSize |
integer |
本页记录数。 |
30 |
| PageNumber |
integer |
页数。 |
1 |
| TotalCount |
integer |
总记录数。 |
1 |
| Items |
array<object> |
SQL Pattern 详情。 |
|
|
object |
详情。 |
||
| AvgStageCount |
string |
平均 Stage 个数。 |
2 |
| MaxCpuTime |
string |
最大计算耗时,单位:ms。 |
17 |
| AccessIP |
string |
客户端 IP。 说明
仅当 |
100.104.***.*** |
| AvgScanSize |
string |
平均扫描量,单位:KB。 |
0 |
| MaxScanSize |
string |
最大扫描量,单位:KB。 |
0 |
| MaxPeakMemory |
string |
最大峰值内存,单位:KB。 |
480096 |
| AvgCpuTime |
string |
平均计算耗时,单位:ms。 |
1.0625 |
| User |
string |
用户名。 说明
仅当 |
test_acc |
| AvgPeakMemory |
string |
平均峰值内存,单位:KB。 |
240048 |
| MaxStageCount |
string |
最大 Stage 个数。 |
2 |
| MaxTaskCount |
string |
最大 Task 个数。 |
2 |
| InstanceName |
string |
集群 ID。 |
am-bp1r053byu48p**** |
| QueryCount |
string |
查询总数。 |
16 |
| ReportDate |
string |
查询日期。 |
2021-08-30 |
| Pattern |
string |
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 |
平均 Task 个数。 |
2 |
| RequestId |
string |
请求 ID。 |
B6F2D1B4-2C9F-5622-B424-5E7965****** |
示例
正常返回示例
JSON格式
{
"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******"
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。