Use DescribeAvailableAdvices to get optimization advice.
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
You can call the DescribeDBClusters API to query for the IDs of Data Warehouse Edition clusters. |
am-bp198m028ih55**** |
| RegionId |
string |
Yes |
The region ID. Note
You can call the DescribeRegions API to query for the IDs of available regions. |
cn-hangzhou |
| AdviceDate |
integer |
Yes |
The date on which the advice was generated, in the yyyyMMdd format and in UTC. Note
Advice is generated daily after an early-morning analysis. To query for advice, you must specify a date that is at least one day prior to the current date (T-1). For example, if the current date is 20240627, you must specify 20240626 or an earlier date. |
20221124 |
| Lang |
string |
Yes |
The language for the advice. Valid values:
|
zh |
| PageSize |
integer |
Yes |
The number of entries per page. Valid values:
|
30 |
| PageNumber |
integer |
Yes |
The page number. The value must be a positive integer. Default value: 1. |
1 |
| AdviceType |
string |
No |
The type of advice. Valid values:
|
Index |
| Keyword |
string |
No |
The keyword for a fuzzy search by table name. |
you_table_name |
| SchemaTableName |
string |
No |
The concatenation of the database name and the table name. |
tpch.lineitem |
| Order |
string |
No |
The sort order of the query results. The value is a JSON string, for example,
Note
By default, results are sorted by expected benefit in descending order. |
[{"Field":"Benefit","Type":"Desc"}] |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response object. |
||
| Items |
array<object> |
The details. |
|
|
object |
The list of advice. |
||
| AdviceId |
string |
The advice ID. |
dcd04135-0925-4aed-a5a7-e7d92cb1**** |
| AdviceDate |
string |
The date when the advice was generated. The date is in the yyyyMMdd format. The time is in UTC. |
20221124 |
| AdviceType |
string |
The type of the advice. Valid values:
|
Index |
| SQL |
string |
The SQL statement to apply the advice. |
alter table `schema1`.`table1` drop key col1_1_idx |
| Reason |
string |
The reason why the optimization advice is generated. |
Not used for 15 days, historical usage probability is less than 1% |
| Benefit |
string |
The benefit of the advice. |
Saves 0.4 GB of storage space. |
| TotalCount |
integer |
The total number of returned suggestions. The value is greater than or equal to 0 and does not exceed 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. The value is greater than 0 and does not exceed 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 |
The index fields. |
index |
| PageNumber |
integer |
The page number. The value is greater than 0 and does not exceed 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 request ID. |
96A55627-28E9-5E47-B8F6-D786BE551349 |
| TotalCount |
integer |
The total number of returned results. The value is greater than or equal to 0 and does not exceed the maximum value of the Integer data type. Default value: 0. |
30 |
| SchemaTableNames |
array |
A list of concatenated strings of database and table names. |
|
|
string |
A concatenated string of a database name and a 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": "Not used for 15 days, historical usage probability is less than 1%",
"Benefit": "Saves 0.4 GB of storage space.",
"TotalCount": 30,
"PageSize": 30,
"PageNumber": 1,
"SchemaName": "adb_demo",
"TableName": "test_table",
"IndexFields": "index"
}
],
"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.