Queries the applied optimization suggestions for an AnalyticDB for MySQL cluster.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| adb:DescribeAppliedAdvices | get | *DBClusterLakeVersion acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId} |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| DBClusterId | string | Yes | The cluster ID. | am-uf6g8w25jacm7**** |
| RegionId | string | Yes | The region ID. | cn-hangzhou |
| StartTime | long | No | The start date of the time range to query. Specify the date in the yyyyMMdd format. | 20220811 |
| EndTime | long | No | The end date of the time range to query. Specify the date in the yyyyMMdd format. | 20220824 |
| Lang | string | No | The display language of the suggestion. Valid values:
| zh |
| PageSize | long | No | The number of entries per page. Valid values:
| 30 |
| PageNumber | long | No | The page number. Pages start from page 1. Default value: 1. | 1 |
| AdviceType | string | No | The type of the suggestion. Valid values:
| INDEX |
| Keyword | string | No | The keyword that is used to query information by table name. | you_table_name |
| SchemaTableName | string | No | The name of the table in the DatabaseName.TableName format. | tpch.lineitem |
| Order | string | No | The order by which to sort query results. Specify the parameter value in the JSON format. Example:
Note
If you do not specify this parameter, optimization suggestions are sorted in descending order based on the submission time.
| [{\"Field\":\"AdviceType\",\"Type\":\"Desc\"}] |
Response parameters
Examples
Sample success responses
JSONformat
{
"Items": [
{
"AdviceId": "7417db9c-914d-43f3-a123-4d0e448f****",
"SubmitTime": 2208131600,
"SubmitStatus": "SUCCEED",
"SQL": "alter table `schema1`.`table1` drop key col1_1_idx",
"RollbackSQL": "alter table `schema1`.`table1` add key col1_1_idx(col1)",
"JobStatus": "SUCCEED",
"Benefit": "0.4 GB of storage saved",
"BuildSQL": "build table `schema1`.`table1`",
"TotalCount": 1,
"PageSize": 30,
"PageNumber": 1,
"SchemaName": "adb_demo",
"TableName": "test"
}
],
"PageNumber": 1,
"PageSize": 30,
"RequestId": "84489769-3065-5A28-A4CB-977CD426F1C3",
"TotalCount": 1,
"SchemaTableNames": [
[
"tpch.lineitem",
"tpch.partsupp",
"tpch.orders"
]
]
}Error codes
For a list of error codes, visit the Service error codes.
