The DescribeAvailableAdvices operation lists available optimization suggestions.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
adb:DescribeAvailableAdvices |
get |
DBCluster
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBClusterId |
string |
Yes |
The ID of the cluster. Note
Call DescribeDBClusters to view the cluster ID of an AnalyticDB for MySQL cluster. |
am-bp198m028ih55**** |
| RegionId |
string |
Yes |
The ID of the region. Note
Call DescribeRegions to view the IDs of available regions. |
cn-hangzhou |
| AdviceDate |
integer |
Yes |
The date when the suggestion was generated, in yyyyMMdd format (UTC). Note
Data is generated daily after analysis at midnight. Specify a date that is at least one day earlier than today to retrieve results. For example, if today is 20240627, specify 20240626 or an earlier date. |
20221124 |
| Lang |
string |
Yes |
The language used to display suggestions. Valid values:
|
zh |
| PageSize |
integer |
Yes |
The number of entries per page. Valid values:
|
30 |
| PageNumber |
integer |
Yes |
The page number. Valid values: integers greater than 0 and less than or equal to the maximum value of the Integer data type. Default value: 1. |
1 |
| AdviceType |
string |
No |
The type of suggestion. Valid values:
|
Index |
| Keyword |
string |
No |
The keyword used to search for suggestions. Supports fuzzy search by table name. |
you_table_name |
| SchemaTableName |
string |
No |
The concatenation of the database name and table name. |
tpch.lineitem |
| Order |
string |
No |
Sort query results by a specified field. Format as a JSON string, such as
Note
If not specified, results are sorted by expected optimization benefit in descending order. |
[{"Field":"Benefit","Type":"Desc"}] |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response object. |
||
| Items |
array<object> |
Details. |
|
|
object |
The list of suggestions. |
||
| AdviceId |
string |
The ID of the suggestion. |
dcd04135-0925-4aed-a5a7-e7d92cb1**** |
| AdviceDate |
string |
The date when the suggestion was generated, in yyyyMMdd format (UTC). |
20221124 |
| AdviceType |
string |
The type of suggestion. Valid values:
|
Index |
| SQL |
string |
The SQL statement to apply the suggestion. |
alter table `schema1`.`table1` drop key col1_1_idx |
| Reason |
string |
The reason for generating the suggestion. |
15天未使用,历史使用统计概率小于1% |
| Benefit |
string |
The benefit of applying the suggestion. |
节省0.4 GB的存储空间。 |
| TotalCount |
integer |
The total number of suggestions returned. Valid values: integers greater than or equal to 0 and less than or equal to the maximum value of the Integer data type. Default value: 0. |
30 |
| PageSize |
integer |
The number of entries per page. Valid values:
|
30 |
| PageNumber |
integer |
The page number. Valid values: integers greater than 0 and less than or equal to the maximum value of the Integer data type. Default value: 1. |
1 |
| SchemaName |
string |
The database name. |
adb_demo |
| TableName |
string |
The table name. |
test_table |
| IndexFields |
string |
||
| PageNumber |
integer |
The page number. Valid values: integers greater than 0 and less than or equal to the maximum value of the Integer data type. Default value: 1. |
1 |
| PageSize |
integer |
The number of entries per page. Valid values:
|
30 |
| RequestId |
string |
The ID of the request. |
96A55627-28E9-5E47-B8F6-D786BE551349 |
| TotalCount |
integer |
The total number of results returned. Valid values: integers greater than or equal to 0 and less than or equal to the maximum value of the Integer data type. Default value: 0. |
30 |
| SchemaTableNames |
array |
The list of concatenated database names and table names. |
|
|
string |
The concatenation of the database name and table name. |
[ "tpch.lineitem", "tpch.partsupp", "tpch.orders" ] |
Examples
Success response
JSON format
{
"Items": [
{
"AdviceId": "dcd04135-0925-4aed-a5a7-e7d92cb1****",
"AdviceDate": "20221124",
"AdviceType": "Index",
"SQL": "alter table `schema1`.`table1` drop key col1_1_idx",
"Reason": "15天未使用,历史使用统计概率小于1%",
"Benefit": "节省0.4 GB的存储空间。",
"TotalCount": 30,
"PageSize": 30,
"PageNumber": 1,
"SchemaName": "adb_demo",
"TableName": "test_table",
"IndexFields": ""
}
],
"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. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.