All Products
Search
Document Center

AnalyticDB:DescribeAvailableAdvices

Last Updated:Jan 24, 2025

Queries the available suggestions for cluster optimization.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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 Resources is 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.
OperationAccess levelResource typeCondition keyAssociated operation
adb:DescribeAvailableAdvicesget
DBCluster
acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBClusterIdstringYes

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****
RegionIdstringYes

The region ID of the cluster.

Note You can call the DescribeRegions operation to query the most recent region list.
cn-hangzhou
AdviceDatelongYes

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
LangstringYes

The display language of the suggestion. Default value: zh. Valid values:

  • zh: simplified Chinese
  • en: English
  • ja: Japanese
  • zh-tw: traditional Chinese
zh
PageSizelongYes

The number of entries to return on each page. Default value: 30. Valid values:

  • 30
  • 50
  • 100
30
PageNumberlongYes

The number of the page to return. The value must be an integer that is greater than 0. Default value: 1.

1
AdviceTypestringNo

The type of the suggestion. Valid values:

  • INDEX: index optimization.
  • TIERING: hot and cold data optimization.
Index
KeywordstringNo

The keyword that is used to query information by table name.

you_table_name
SchemaTableNamestringNo

The name of the table in the DatabaseName.TableName format.

tpch.lineitem
OrderstringNo

The order by which to sort query results. Specify the parameter value in the JSON format. Example: [{"Field":"SchemaName","Type":"Asc"}].

  • Field specifies the field by which to sort the query results. Valid values:

    • SchemaName: the name of the database.
    • TableName: the name of the table.
    • Benefit: the expected benefits of the applied optimization suggestion.
  • Type specifies the sorting order. Valid values:

    • Asc: ascending order.
    • Desc: descending order.
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

ParameterTypeDescriptionExample
object

The response parameters.

Itemsarray<object>

The queried suggestions.

Itemsobject
AdviceIdstring

The suggestion ID.

dcd04135-0925-4aed-a5a7-e7d92cb1****
AdviceDatestring

The time when the suggestion was generated. The time follows the ISO 8601 standard in the yyyyMMdd format. The time is displayed in UTC.

20221124
AdviceTypestring

The type of the suggestion. Valid values:

  • Index: index optimization.
  • Tiering: hot and cold data optimization.
Index
SQLstring

The SQL statement that is used to apply the suggestion.

alter table `schema1`.`table1` drop key col1_1_idx
Reasonstring

The reason why the suggestion was generated.

Unused for 15 days, historical usage less than 1%
Benefitstring

The benefit of the suggestion.

0.4 GB of storage saved
TotalCountlong

The total number of entries returned. Minimum value: 0. Default value: 0.

30
PageSizelong

The number of entries per page. Valid values:

  • 30 (default)
  • 50
  • 100
30
PageNumberlong

The page number. Pages start from 1. Default value: 1.

1
SchemaNamestring

The name of the schema.

adb_demo
TableNamestring

The name of the table.

test_table
PageNumberlong

The page number of the returned page. The value must be an integer that is greater than 0. Default value: 1.

1
PageSizelong

The number of entries returned per page. Default value: 30. Valid values:

  • 30
  • 50
  • 100
30
RequestIdstring

The ID of the request.

96A55627-28E9-5E47-B8F6-D786BE551349
TotalCountlong

The total number of entries returned. The value must be an integer that is greater than or equal to 0. Default value: 0.

30
SchemaTableNamesarray

The name of the table in the DatabaseName.TableName format.

SchemaTableNamesstring

The name of the table in the DatabaseName.TableName format.

[ "tpch.lineitem", "tpch.partsupp", "tpch.orders" ]

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 codeError codeError messageDescription
400MissingParameter.PageSizeThe PageSize parameter is required.The PageSize parameter is not specified.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-04-17The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details
2023-04-06The Error code has changedView Change Details