Queries information of the best-performing and worst-performing instances based on query governance data.

Usage notes

  • If you use an Alibaba Cloud SDK, make sure that the aliyun-sdk-core version is later than V2.1.8. We recommend that you use the latest version.
  • The version of your Database Autonomy Service (DAS) SDK must be V2.1.8 or later.
  • If you use an SDK to call the DAS service, you must set the region to cn-shanghai.
  • This operation supports the following database services:
    • ApsaraDB RDS for MySQL
    • PolarDB for MySQL
    • ApsaraDB RDS for PostgreSQL

Request parameters

Parameter Type Required Example Description
Action String Yes GetQueryOptimizeDataTop

The operation that you want to perform. Set the value to GetQueryOptimizeDataTop.

Engine String Yes MySQL

The database engine. Valid values:

  • MySQL
  • PolarDBMySQL
  • PostgreSQL
InstanceIds String No rm-2ze8g2am97624****

The instance IDs. Separate multiple IDs with commas (,).

TagNames String No None

A reserved parameter.

Time String Yes 1642953600000

The time range to query. Specify the time in the UNIX timestamp format. Unit: milliseconds.

Type String Yes RED

The type of instances that you want to query. Valid values:

  • RED: the best-performing instances
  • BLACK: the worst-performing instances

Response parameters

Parameter Type Example Description
Code String 200

The returned HTTP status code.

Message String Successful

The message that is returned for the request.

Data Object

The details about the instances.

Total Long 10

The total number of returned entries.

PageNo Integer None

A reserved parameter.

PageSize Integer None

A reserved parameter.

Extra String None

A reserved parameter.

List Array of QueryOptimizeDataTops

The list of instances.

InstanceId String rm-2ze8g2am97624****

The ID of the instance.

Type String sqlExecuteCount

The metric name. Valid values:

  • sqlExecuteCount: the number of executions of slow queries.
  • optimizedSqlExecuteCount: the number of executions of slow queries that need to be optimized.
Value double 100

The metric value.

RequestId String B6D17591-B48B-4D31-9CD6-9B9796B2****

The ID of the request.

Success String true

Indicates whether the request is successful. Valid values:

  • true
  • false

Examples

Sample requests

http(s)://das.cn-shanghai.aliyuncs.com/?Action=GetQueryOptimizeDataTop
&Engine=MySQL
&InstanceIds=rm-2ze8g2am97624****
&TagNames=None
&Time=1642953600000
&Type=RED
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<GetQueryOptimizeDataTopResponse>
    <Code>200</Code>
    <Message>Successful</Message>
    <Data>
        <Total>10</Total>
        <Extra>None</Extra>
        <List>
            <InstanceId>rm-2ze8g2am97624****</InstanceId>
            <Type>sqlExecuteCount</Type>
            <Value>100</Value>
        </List>
    </Data>
    <RequestId>B6D17591-B48B-4D31-9CD6-9B9796B2****</RequestId>
    <Success>true</Success>
</GetQueryOptimizeDataTopResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Code" : 200,
  "Message" : "Successful",
  "Data" : {
    "Total" : 10,
    "Extra" : "None",
    "List" : {
      "InstanceId" : "rm-2ze8g2am97624****",
      "Type" : "sqlExecuteCount",
      "Value" : 100
    }
  },
  "RequestId" : "B6D17591-B48B-4D31-9CD6-9B9796B2****",
  "Success" : true
}

Error codes

HTTP status code Error code Error message Description
400 InvalidParams The request parameters are invalid. The error message returned because the specified request parameters are invalid.

For a list of error codes, visit the API Error Center.