Queries the available suggestions for cluster optimization.
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:DescribeAvailableAdvices | get | DBCluster acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId} |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| DBClusterId | string | Yes | The ID of the cluster. Note
You can call the DescribeDBClusters operation to query the IDs of Data Warehouse Edition (V3.0) clusters.
| am-bp198m028ih55**** |
| 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 |
| AdviceDate | long | Yes | The date when the suggestion is generated. Specify the date in the yyyyMMdd format. The date must be in UTC. Note
Suggestions are generated after analysis after midnight every day. You must specify a date that is at least one day earlier than the current date. For example, if the current date is 20240627, you must specify 20240626 or an earlier date.
| 20221124 |
| Lang | string | Yes | The display language of the suggestion. Default value: zh. Valid values:
| zh |
| PageSize | long | Yes | The number of entries to return on each page. Default value: 30. Valid values:
| 30 |
| PageNumber | long | Yes | The number of the page to return. The value must be an integer that is greater than 0. 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, the query results are sorted in descending order based on the Benefit field.
| [{"Field":"Benefit","Type":"Desc"}] |
Response parameters
Examples
Sample success responses
JSONformat
{
"Items": [
{
"AdviceId": "dcd04135-0925-4aed-a5a7-e7d92cb1****",
"AdviceDate": "20221124",
"AdviceType": "Index",
"SQL": "alter table `schema1`.`table1` drop key col1_1_idx",
"Reason": "Unused for 15 days, historical usage less than 1%",
"Benefit": "0.4 GB of storage saved",
"TotalCount": 30,
"PageSize": 30,
"PageNumber": 1,
"SchemaName": "adb_demo",
"TableName": "test_table"
}
],
"PageNumber": 1,
"PageSize": 30,
"RequestId": "96A55627-28E9-5E47-B8F6-D786BE551349",
"TotalCount": 30,
"SchemaTableNames": [
"[\n \"tpch.lineitem\",\n \"tpch.partsupp\",\n \"tpch.orders\"\n]"
]
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | MissingParameter.PageSize | The PageSize parameter is required. | The PageSize parameter is not specified. |
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2024-04-17 | The Error code has changed. The request parameters of the API has changed. The response structure of the API has changed | View Change Details |
| 2023-04-06 | The Error code has changed | View Change Details |
