All Products
Search
Document Center

AnalyticDB:DescribeAppliedAdvices

Last Updated:Apr 14, 2026

Call DescribeAppliedAdvices to retrieve applied optimization suggestions.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

adb:DescribeAppliedAdvices

get

DBCluster

acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DBClusterId

string

Yes

The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

Note

To query the IDs of AnalyticDB for MySQL Data Warehouse Edition clusters, call the DescribeDBClusters API.

am-uf6g8w25jacm7****

RegionId

string

Yes

The region ID.

Note

To query available region IDs, call the DescribeRegions API.

cn-hangzhou

StartTime

integer

No

The start date of the query time range, in yyyyMMdd format and in UTC.

20220811

EndTime

integer

No

The end date of the query time range, in yyyyMMdd format and in UTC.

20220824

Lang

string

No

The language of the suggestions. Valid values:

  • zh: Simplified Chinese (default)

  • en: English

  • ja: Japanese

  • zh-tw: Traditional Chinese

zh

PageSize

integer

No

The number of entries to return per page. Valid values:

  • 30 (default)

  • 50

  • 100

30

PageNumber

integer

No

The page number. The value must be an integer that is greater than 0 and does not exceed the maximum value of the integer data type. Default: 1.

1

AdviceType

string

No

The type of suggestions to return. Valid values:

  • INDEX: index optimization.

  • TIERING: data tiering.

INDEX

Keyword

string

No

A keyword for performing a fuzzy search by table name.

you_table_name

SchemaTableName

string

No

The schema name and table name. The value must be in the <schema>.<table> format.

tpch.lineitem

Order

string

No

The sort order for the results. The value must be a JSON string, such as [{"Field":"SchemaName","Type":"Asc"}]. The JSON string contains the following fields:

  • Field: The field by which to sort the results. Valid values:
    • SchemaName: schema name.

    • TableName: table name.

    • JobStatus: Status of the table build job.

    • SubmitTime: Time when the suggestion was created.

    • Benefit: Expected optimization benefit.

  • Type: the sort order. Valid values:
    • Asc: ascending order.

    • Desc: descending order.

Note

If this parameter is not specified, the results are sorted by creation time (SubmitTime) in descending order by default.

[{"Field":"Benefit","Type":"Desc"}]

Response elements

Element

Type

Description

Example

object

The response object.

Items

array<object>

The details.

object

The advice.

AdviceId

string

The advice ID.

7417db9c-914d-43f3-a123-4d0e448f****

SubmitTime

string

The submission time. This value is a UTC time that is formatted as yyMMddHHmm.

2208131600

SubmitStatus

string

The submission status. Valid values:

  • SUCCEED: The submission is successful.

  • FAILED: The submission fails.

SUCCEED

SQL

string

The SQL statement that is used to apply the advice.

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

RollbackSQL

string

The SQL statement that is used to roll back the advice.

alter table `schema1`.`table1` add key col1_1_idx(col1)

JobStatus

string

The state of the task that is run to apply the advice. Valid values:

  • SUCCEED: The task is successful.

  • FAILED: The task fails.

SUCCEED

Benefit

string

The benefit of the advice.

Saves 0.4 GB of storage space

BuildSQL

string

The SQL statement that is used to run the build task.

build table `schema1`.`table1`

TotalCount

integer

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

1

PageSize

integer

The number of entries per page. Valid values:

  • 30 (default)

  • 50

  • 100

30

PageNumber

integer

The page number. The value is an integer that is greater than 0. Default value: 1.

1

SchemaName

string

The database name.

adb_demo

TableName

string

The table name.

test

IndexFields

string

The index fields.

index

PageNumber

integer

The page number. The value is an integer that is greater than 0. Default value: 1.

1

PageSize

integer

The number of entries per page. Valid values:

  • 30 (default)

  • 50

  • 100

30

RequestId

string

The request ID.

84489769-3065-5A28-A4CB-977CD426F1C3

TotalCount

integer

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

1

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": "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": "Saves 0.4 GB of storage space",
      "BuildSQL": "build table `schema1`.`table1`",
      "TotalCount": 1,
      "PageSize": 30,
      "PageNumber": 1,
      "SchemaName": "adb_demo",
      "TableName": "test",
      "IndexFields": "index"
    }
  ],
  "PageNumber": 1,
  "PageSize": 30,
  "RequestId": "84489769-3065-5A28-A4CB-977CD426F1C3",
  "TotalCount": 1,
  "SchemaTableNames": [
    "[\n  \"tpch.lineitem\",\n  \"tpch.partsupp\",\n  \"tpch.orders\"\n]"
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.