All Products
Search
Document Center

AnalyticDB:DescribePatternPerformance

Last Updated:Aug 28, 2026

Queries the performance metrics of an SQL pattern, such as query duration and average memory usage, within a specified time range.

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:DescribePatternPerformance

get

DBCluster

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

None None

Request parameters

Parameter

Type

Required

Description

Example

DBClusterId

string

Yes

The cluster ID.

Note

Call DescribeDBClusters to query cluster IDs.

am-****************

StartTime

string

Yes

The start of the time range to query. Format: yyyy-MM-ddTHH:mm:ssZ (UTC, ISO 8601).

Note
  • Only data within the last 14 days can be queried. For example, if the current date is November 22 (UTC+8), the earliest queryable date is November 9 (StartTime: 2021-11-08T16:00:00Z). Earlier values result in an empty Performances response.

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

2021-11-18T00:00:00Z

EndTime

string

Yes

The end of the time range to query. Format: yyyy-MM-ddTHH:mm:ssZ (UTC, ISO 8601).

Note

The end time must be later than the start time.

2021-11-18T18:05:00Z

RegionId

string

Yes

The region ID of the cluster.

Note

Call DescribeRegions to query available regions.

cn-hangzhou

PatternId

string

Yes

The SQL pattern ID.

Note

Call DescribeSQLPatterns to query SQL pattern IDs.

3847585356974******

Response elements

Element

Type

Description

Example

object

The response parameters.

EndTime

string

The end time of the query. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).

2021-11-18T18:05Z

RequestId

string

The request ID.

210f47011634026610213529******

StartTime

string

The start time of the query. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).

2021-11-18T00:00Z

Performances

array<object>

The queried performance metrics.

array<object>

The queried performance metric.

Key

string

The performance metric. Valid values:

  • AnalyticDB_PatternQueryCount: total number of queries for the SQL pattern.

  • AnalyticDB_PatternQueryTime: total time consumed by queries for the SQL pattern.

  • AnalyticDB_PatternExecutionTime: total execution duration for the SQL pattern.

  • AnalyticDB_PatternPeakMemory: peak memory usage for the SQL pattern.

  • AnalyticDB_PatternScanSize: data scanned for the SQL pattern.

AnalyticDB_PatternQueryCount

Unit

string

The unit of the performance metric. Valid values:

  • For query duration (AnalyticDB_PatternQueryTime or AnalyticDB_PatternExecutionTime): ms.

  • For memory usage (AnalyticDB_PatternPeakMemory): MB.

  • For data scanned (AnalyticDB_PatternScanSize): MB.

  • For query count (AnalyticDB_PatternQueryCount): empty.

ms

Series

array<object>

The queried performance metrics.

object

The queried performance metrics.

Values

array

The queried performance metrics.

string

The value of the performance metric.

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

Name

string

The name of the metric value. Valid values:

  • When Key is AnalyticDB_PatternQueryCount: pattern_query_count (number of executions for the SQL pattern).

  • When Key is AnalyticDB_PatternQueryTime:

    • average_query_time: average total time consumed.

    • max_query_time: maximum total time consumed.

  • When Key is AnalyticDB_PatternExecutionTime:

    • average_execution_time: average execution duration.

    • max_execution_time: maximum execution duration.

  • When Key is AnalyticDB_PatternPeakMemory:

    • average_peak_memory: average peak memory usage.

    • max_peak_memory: maximum peak memory usage.

  • When Key is AnalyticDB_PatternScanSize:

    • average_scan_size: average data scanned.

    • max_scan_size: maximum data scanned.

max_query_time

AccessIp

string

The IP address of the client that submitted the SQL pattern.

172.16.14.*

FailedCount

integer

The number of failed queries for the SQL pattern within the time range.

0

QueryCount

integer

The total number of queries for the SQL pattern within the time range.

35018

SQLPattern

string

The SQL statement representing the SQL pattern.

SELECT *nFROM HIVE.`ADB_EXTERNAL_TPCH_10GB`.`External_customer`nLIMIT ?

Tables

string

The tables associated with the SQL pattern.

tpch_1g.part;tpch_1g.supplier;tpch_1g.lineitem;tpch_1g.partsupp;tpch_1g.orders;tpch_1g.nation

User

string

The database account used to execute the SQL statements.

test

Examples

Success response

JSON format

{
  "EndTime": "2021-11-18T18:05Z",
  "RequestId": "210f47011634026610213529******",
  "StartTime": "2021-11-18T00:00Z",
  "Performances": [
    {
      "Key": "AnalyticDB_PatternQueryCount",
      "Unit": "ms",
      "Series": [
        {
          "Values": [
            "[               \"2021-11-18 13:38:00\",               \"224\"             ]"
          ],
          "Name": "max_query_time"
        }
      ]
    }
  ],
  "AccessIp": "172.16.14.*",
  "FailedCount": 0,
  "QueryCount": 35018,
  "SQLPattern": "SELECT *nFROM HIVE.`ADB_EXTERNAL_TPCH_10GB`.`External_customer`nLIMIT ?",
  "Tables": "tpch_1g.part;tpch_1g.supplier;tpch_1g.lineitem;tpch_1g.partsupp;tpch_1g.orders;tpch_1g.nation",
  "User": "test"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.