Advice on missing index handling

Last Updated: Sep 20, 2017

Description

Based on the SQL statement running status and performance of RDS, the system notifies the user of the database tables with missing indexes and recommends the SQL statement for adding indexes.

Request parameters

Name Type Required? Description
Action String Yes Required parameter. Value: DescribeOptimizeAdviceOnMissIndex.
DBInstanceId String Yes Instance ID.
PageSize Integer No Number of records on every page. Values: 30, 50, and 100. Default value: 30.
PageNumber Integer No Page number, which must be greater than 0, but must not exceed the maximum Integer value. Default value: 1.

Return parameters

Name Type Description
TotalRecordCount Integer Total number of records.
PageNumber Integer Page number.
PageRecordCount Integer Number of SQL statements displayed on the current page.
Items List<AdviceOnMissPK> None

AdviceOnMissPK parameters

Name Type Description
DBName String Name of a database.
TableName String Name of the database table.
QueryColumn String Query column for missing indexes.
SQLText String Recommended CREATE INDEX statement.

Example

  • Request example

    1. https://rds.aliyuncs.com/?Action=DescribeOptimizeAdviceOnMissIndex
    2. &DBInstanceId=riauvjz6zajfiq6ba1370329449201
    3. &<Public Request Parameters>
  • Return example

    XML format:

    1. <DescribeOptimizeAdviceOnMissIndexResponse>
    2. <RequestId>08A3B71B-FE08-4B03-974F-CC7EA6DB1828</RequestId>
    3. <TotalRecordCount>1</TotalRecordCount>
    4. <PageNumber>1</PageNumber>
    5. <PageRecordCount>1<PageRecordCount>
    6. <Items>
    7. <AdviceOnMissIndex>
    8. <DBName>DBTest11</DBName>
    9. <TableName>Tabletest12</TableName>
    10. <QueryColumn>nickname</QueryColumn>
    11. <SQLText>Alter table Tabletest12 add INDEX index_nickname(niakname)</ SQLText>
    12. </AdviceOnMissIndex>
    13. </Items>
    14. </DescribeOptimizeAdviceOnMissIndex Response>

    JSON format:

    1. {
    2. "PageNumber":1,
    3. "TotalRecordCount":1,
    4. "PageRecordCount":1
    5. "Items":
    6. {"AdviceOnMissIndex":
    7. [
    8. {
    9. "DBName":"DBTest11"
    10. "TableName":"Tabletest12"
    11. "QueryColumn":"nickname"
    12. "SQLText":"Alter table Tabletest12 add INDEX index_nickname(niakname) "
    13. }
    14. ]
    15. },
    16. "RequestId": "08A3B71B-FE08-4B03-974F-CC7EA6DB1828"
    17. }
Thank you! We've received your feedback.