All Products
Search
Document Center

AnalyticDB:DescribeSQLPatterns

Last Updated:Sep 11, 2024

Queries a list of SQL patterns for an AnalyticDB for MySQL Data Lakehouse Edition (V3.0) 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

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

Request parameters

ParameterTypeRequiredDescriptionExample
DBClusterIdstringYes

The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster.

Note You can call the DescribeDBClusters operation to query the information about all AnalyticDB for MySQL Data Lakehouse Edition (V3.0) clusters within a region, including cluster IDs.
amv-8vb8de93v9b****
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
  • Only data within the last 14 days can be queried.
  • The maximum time range that can be specified is 24 hours.
  • 2022-09-06T03:06:00Z
    EndTimestringYes

    The end 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 The end time must be later than the start time.
    2022-09-07T03:06:00Z
    RegionIdstringYes

    The region ID of the cluster.

    cn-hangzhou
    KeywordstringNo

    The keyword that is used for the query.

    SELECT
    OrderstringNo

    The order by which to sort query results. Specify the parameter value in the JSON format. Example: [{"Field":"AverageQueryTime","Type":"Asc"}].

    • Field specifies the field by which to sort the query results. Valid values:

      • PatternCreationTime: the earliest commit time of the SQL pattern within the time range to query.
      • AverageQueryTime: the average total amount of time consumed by the SQL pattern within the time range to query.
      • MaxQueryTime: the maximum total amount of time consumed by the SQL pattern within the time range to query.
      • AverageExecutionTime: the average execution duration of the SQL pattern within the time range to query.
      • MaxExecutionTime: the maximum execution duration of the SQL pattern within the time range to query.
      • AveragePeakMemory: the average peak memory usage of the SQL pattern within the time range to query.
      • MaxPeakMemory: the maximum peak memory usage of the SQL pattern within the time range to query.
      • AverageScanSize: the average amount of data scanned based on the SQL pattern within the time range to query.
      • MaxScanSize: the maximum amount of data scanned based on the SQL pattern within the time range to query.
      • QueryCount: the number of queries performed in association with the SQL pattern within the time range to query.
      • FailedCount: the number of failed queries performed in association with the SQL pattern within the time range to query.
    • Type specifies the sorting order. Valid values (case-insensitive):

      • Asc: ascending order.
      • Desc: descending order.
    [{"Field":"AverageQueryTime","Type":"Asc"}]
    PageNumberintegerNo

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

    2
    PageSizeintegerNo

    The number of entries per page. Valid values:

    • 10 (default)
    • 30
    • 50
    • 100
    10
    LangstringNo

    The language. Valid values:

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

    Response parameters

    ParameterTypeDescriptionExample
    object

    The response parameters.

    PageNumberinteger

    The page number.

    2
    PageSizeinteger

    The number of entries per page.

    10
    TotalCountinteger

    The total number of entries returned.

    20
    PatternDetailsarray<object>

    The queried SQL patterns.

    object

    The queried SQL pattern.

    SQLPatternstring

    The statement of the SQL pattern.

    SELECT * FROM KEPLER_META_NODE_STATIC_INFO WHERE elastic_node = ? OR (elastic_node = ? AND enable = ?)
    PatternIdstring

    The ID of the SQL pattern.

    5575924945138******
    Userstring

    The name of the database account that is used to commit the SQL pattern.

    test
    AccessIpstring

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

    192.168.xx.xx
    Tablesstring

    The tables scanned based on the SQL pattern.

    tpch.orders
    PatternCreationTimestring

    The earliest commit time of the SQL pattern within the query time range.

    2022-09-06 05:06:00
    AverageQueryTimedouble

    The average total amount of time consumed by the SQL pattern within the query time range. Unit: milliseconds.

    4
    MaxQueryTimelong

    The maximum total amount of time consumed by the SQL pattern within the query time range. Unit: milliseconds.

    2341
    AverageExecutionTimedouble

    The average execution duration of the SQL pattern within the query time range. Unit: milliseconds.

    234.78
    MaxExecutionTimelong

    The maximum execution duration of the SQL pattern within the query time range. Unit: milliseconds.

    2142
    AveragePeakMemorydouble

    The average peak memory usage of the SQL pattern within the query time range. Unit: bytes.

    234.22
    MaxPeakMemorylong

    The maximum peak memory usage of the SQL pattern within the query time range. Unit: bytes.

    234149
    AverageScanSizedouble

    The average amount of data scanned based on the SQL pattern within the query time range. Unit: bytes.

    234149.23
    MaxScanSizelong

    The maximum amount of data scanned based on the SQL pattern within the query time range. Unit: bytes.

    32212254
    QueryCountlong

    The number of queries executed in association with the SQL pattern within the query time range.

    345
    FailedCountlong

    The number of failed queries executed in association with the SQL pattern within the query time range.

    18
    Blockableboolean

    Indicates whether the execution of the SQL pattern can be intercepted. Valid values:

    • true
    • false
    Note Only SELECT and INSERT statements can be intercepted.
    true
    RequestIdstring

    The request ID.

    F3174013-5B7A-5A47-9FE0-6B5D397BD86B

    Examples

    Sample success responses

    JSONformat

    {
      "PageNumber": 2,
      "PageSize": 10,
      "TotalCount": 20,
      "PatternDetails": [
        {
          "SQLPattern": "SELECT * FROM KEPLER_META_NODE_STATIC_INFO WHERE elastic_node = ? OR (elastic_node = ? AND enable = ?)",
          "PatternId": "5575924945138******",
          "User": "test",
          "AccessIp": "192.168.xx.xx",
          "Tables": "tpch.orders",
          "PatternCreationTime": "2022-09-06 05:06:00",
          "AverageQueryTime": 4,
          "MaxQueryTime": 2341,
          "AverageExecutionTime": 234.78,
          "MaxExecutionTime": 2142,
          "AveragePeakMemory": 234.22,
          "MaxPeakMemory": 234149,
          "AverageScanSize": 234149.23,
          "MaxScanSize": 32212254,
          "QueryCount": 345,
          "FailedCount": 18,
          "Blockable": true,
          "QueryTimeSum": 0,
          "QueryTimePercentage": 0,
          "PeakMemorySum": 0,
          "PeakMemoryPercentage": 0,
          "ScanSizeSum": 0,
          "ScanSizePercentage": 0,
          "AverageOperatorCost": 0,
          "MaxOperatorCost": 0,
          "OperatorCostSum": 0,
          "OperatorCostPercentage": 0,
          "AverageScanCost": 0,
          "MaxScanCost": 0,
          "ScanCostSum": 0,
          "ScanCostPercentage": 0
        }
      ],
      "RequestId": "F3174013-5B7A-5A47-9FE0-6B5D397BD86B",
      "AccessDeniedDetail": ""
    }

    Error codes

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

    Change history

    Change timeSummary of changesOperation
    2024-08-06The response structure of the API has changedView Change Details
    2024-05-14The 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 internal configuration of the API is changed, but the call is not affectedView Change Details