All Products
Search
Document Center

AnalyticDB:DescribeAppliedAdvices

Last Updated:Aug 30, 2024

Queries the applied optimization suggestions for an AnalyticDB for MySQL cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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:
    • The required resource types are displayed in bold characters.
    • 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:DescribeAppliedAdvicesget
  • DBCluster
    acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBClusterIdstringYes

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

Note You can call the DescribeDBClusters operation to query the IDs of AnalyticDB for MySQL Data Warehouse Edition clusters within a region.
am-uf6g8w25jacm7****
RegionIdstringYes

The region ID of the cluster.

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

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyyMMdd format. The time must be in UTC.

20220811
EndTimelongNo

The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyyMMdd format. The time must be in UTC.

20220824
LangstringNo

The display language of the suggestion. Valid values:

  • zh (default): simplified Chinese.
  • en: English.
  • ja: Japanese.
  • zh-tw: traditional Chinese.
zh
PageSizelongNo

The number of entries per page. Valid values:

  • 30 (default)
  • 50
  • 100
30
PageNumberlongNo

The page number. Pages start from page 1. 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.
    • JobStatus: the status of the BUILD job that is triggered on the table.
    • SubmitTime: the time when the suggestion was submitted.
    • 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, optimization suggestions are sorted in descending order based on the submission time.
[{"Field":"Benefit","Type":"Desc"}]

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

Itemsarray<object>

The queried suggestions.

object

The queried suggestion.

AdviceIdstring

The suggestion ID.

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

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

2208131600
SubmitStatusstring

The submission state of the suggestion. Valid values:

  • SUCCEED
  • FAILED
SUCCEED
SQLstring

The SQL statement that is used to apply the suggestion.

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

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

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

The state of the suggestion execution job. Valid values:

  • SUCCEED
  • FAILED
SUCCEED
Benefitstring

The benefit of the suggestion.

0.4 GB of storage saved
BuildSQLstring

The SQL statement that is used to execute the BUILD job.

build table `schema1`.`table1`
TotalCountlong

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

1
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 database.

adb_demo
TableNamestring

The name of the table.

test
PageNumberlong

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

1
PageSizelong

The number of entries per page. Valid values:

  • 30 (default)
  • 50
  • 100
30
RequestIdstring

The request ID.

84489769-3065-5A28-A4CB-977CD426F1C3
TotalCountlong

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

1
SchemaTableNamesarray

The names of the tables in the DatabaseName.TableName format.

string

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

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

Examples

Sample success responses

JSONformat

{
  "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": "0.4 GB of storage saved",
      "BuildSQL": "build table `schema1`.`table1`",
      "TotalCount": 1,
      "PageSize": 30,
      "PageNumber": 1,
      "SchemaName": "adb_demo",
      "TableName": "test"
    }
  ],
  "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

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

Change history

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