All Products
Search
Document Center

AnalyticDB:DescribePatternPerformance

Last Updated:Nov 10, 2025

Queries the information about performance metrics of an SQL pattern such as the query duration and average memory usage for an AnalyticDB for MySQL cluster within a time range.

Operation description

  • General endpoint: adb.aliyuncs.com.
  • Regional public endpoint: adb.<region-id>.aliyuncs.com. Example: adb.cn-hangzhou.aliyuncs.com.
  • Regional Virtual Private Cloud (VPC) endpoint: adb-vpc.<region-id>.aliyuncs.com. Example: adb-vpc.cn-hangzhou.aliyuncs.com.

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:DescribePatternPerformancelist
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBClusterIdstringYes

The cluster ID.

Note You can call the DescribeDBClusters operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.
amv-uf6li1r3do8m****
StartTimestringYes

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

Note
  • If the current date is August 22, 2022 (UTC+8), you can query the data of August 9, 2022 (2022-08-08T16:00:00Z) to the earliest extent. If you want to query the data that is earlier than August 9, 2022 (2022-08-08T16:00:00Z), null is returned.

  • The maximum time range that can be specified is 24 hours.

2022-08-21T02:15:00Z
EndTimestringYes

The end of the time range to query. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

Note The end time must be later than the start time.
2022-08-22T01:06:00Z
RegionIdstringYes

The region ID.

cn-hangzhou
PatternIdstringNo

The SQL pattern ID.

Note You can call the DescribeSQLPatterns operation to query the information about all SQL patterns in an AnalyticDB for MySQL cluster within a period of time, including SQL pattern IDs.
3847585356974******

Response parameters

ParameterTypeDescriptionExample
object
EndTimestring

The end time of the query. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time is displayed in UTC.

2022-08-22T01:06:00Z
RequestIdstring

The request ID.

F21AF487-B8C9-57E0-8E3A-A92BC3611FB6
StartTimestring

The start time of the query. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time is displayed in UTC.

2022-08-21T02:15:00Z
Performancesarray<object>

The queried performance metrics.

PerformanceItemobject

The values of the performance metric at different points in time.

Keystring

The queried performance metric. Valid values:

  • AnalyticDB_PatternQueryCount: the total number of queries executed in association with the SQL pattern.
  • AnalyticDB_PatternQueryTime: the total amount of time consumed by the queries executed in association with the SQL pattern.
  • AnalyticDB_PatternExecutionTime: the execution duration of the queries executed in association with the SQL pattern.
  • AnalyticDB_PatternPeakMemory: the peak memory usage of the queries executed in association with the SQL pattern.
  • AnalyticDB_PatternScanSize: the amount of data scanned in the queries executed in association with the SQL pattern.
AnalyticDB_PatternExecutionTime
Unitstring

The unit of the performance metric. Valid values:

  • If the performance metric is related to the query time (the value of Key is AnalyticDB_PatternQueryTime or AnalyticDB_PatternExecutionTime), ms is returned.
  • If the performance metric is related to the peak memory usage (the value of Key is AnalyticDB_PatternPeakMemory), MB is returned.
  • If the performance metric is related to the amount of data scanned (the value of Key is AnalyticDB_PatternScanSize), MB is returned.
  • If the performance metric is related to the number of queries (the value of Key is AnalyticDB_PatternQueryCount), null is returned.
ms
Seriesarray<object>

The values of the performance metrics.

SeriesItemobject
Valuesarray

The values of the performance metric.

valuesstring

The value of the performance metric at a point in time.

[ "2021-11-18 13:38:00", "224" ]
Namestring

The name of the performance metric value. Valid values:

  • If the value of Key is AnalyticDB_PatternQueryCount, pattern_query_count is returned, which indicates the number of executions of the SQL statements in association with the SQL pattern.

  • If the value of Key is AnalyticDB_PatternQueryTime, the following values are returned:

    • average_query_time, which indicates the average total amount of time consumed by the SQL statements in association with the SQL pattern.
    • max_query_time, which indicates the maximum total amount of time consumed by the SQL statements in association with the SQL pattern.
  • If the value of Key is AnalyticDB_PatternExecutionTime, the following values are returned:

    • average_execution_time, which indicates the average execution duration of the SQL statements in association with the SQL pattern.
    • max_execution_time, which indicates the maximum execution duration of the SQL statements in association with the SQL pattern.
  • If the value of Key is AnalyticDB_PatternPeakMemory, the following values are returned:

    • average_peak_memory, which indicates the average peak memory usage of the SQL statements in association with the SQL pattern.
    • max_peak_memory, which indicates the maximum peak memory usage of the SQL statements in association with the SQL pattern.
  • If the value of Key is AnalyticDB_PatternScanSize, the following values are returned:

    • average_scan_size, which indicates the average amount of data scanned by the SQL statements in association with the SQL pattern.
    • max_scan_size, which indicates the maximum amount of data scanned by the SQL statements in association with the SQL pattern.
max_query_time

Examples

Sample success responses

JSONformat

{
  "EndTime": "2022-08-22T01:06:00Z",
  "RequestId": "F21AF487-B8C9-57E0-8E3A-A92BC3611FB6",
  "StartTime": "2022-08-21T02:15:00Z",
  "Performances": [
    {
      "Key": "AnalyticDB_PatternExecutionTime",
      "Unit": "ms",
      "Series": [
        {
          "Values": [
            [
              "2021-11-18 13:38:00",
              224
            ]
          ],
          "Name": "max_query_time"
        }
      ]
    }
  ],
  "User": "",
  "AccessIp": "",
  "SQLPattern": "",
  "Tables": "",
  "FailedCount": 0,
  "QueryCount": 0
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-10-21The response structure of the API has changedView Change Details
2023-12-08The internal configuration of the API is changed, but the call is not affectedView Change Details
2023-06-08The request parameters of the API has changedView Change Details