All Products
Search
Document Center

AnalyticDB:DescribeSlowLogRecords

Last Updated:Jan 14, 2026

Queries the details of slow query logs for an AnalyticDB for MySQL cluster.

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

get

*DBCluster

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

None None

Request parameters

Parameter

Type

Required

Description

Example

DBClusterId

string

Yes

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

Note

Call the DescribeDBClusters operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters in the destination region.

am-bp1rqvm70uh2****

StartTime

string

Yes

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

2021-05-20T16:00:00Z

EndTime

string

Yes

The end of the time range to query. Specify the time 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. The time range between the start time and the end time cannot exceed 7 days.

2021-05-27T16:00:00Z

DBName

string

No

The name of the database.

adb_demo

PageSize

integer

No

The number of entries to return on each page. Valid values: 30 (default), 50, and 100.

30

PageNumber

integer

No

The page number. The value must be an integer that is greater than 0. Default value: 1.

1

ProcessID

string

No

The process ID.

2021052716044317201616624903453******

Order

string

No

The sorting order of the results. The value is an ordered JSON array. The results are sorted in the order of the objects in the array. Each object contains the Field and Type parameters. Example: [{"Field":"ExecutionStartTime","Type":"Desc"},{"Field":"ScanRows","Type":"Asc"}].

  • Field: the field to sort by. Valid values:

    • HostAddress: the IP address of the client that is used to connect to the database.

    • UserName: the username.

    • ExecutionStartTime: the start time of the SQL statement execution.

    • QueryTime: the execution duration of the SQL statement.

    • PeakMemoryUsage: the peak memory usage for executing the SQL statement.

    • ScanRows: the number of rows scanned from the data source.

    • ScanSize: the amount of scanned data.

    • ScanTime: the total time consumed to scan data.

    • PlanningTime: the time consumed to generate the execution plan.

    • WallTime: the total CPU time consumed by all operators in the query on each node.

    • ProcessID: the process ID.

  • Type: the sorting type. Valid values:

    • Desc: descending order.

    • Asc: ascending order.

[{"Field":"ExecutionStartTime","Type":"Desc"},{"Field":"ScanRows","Type":"Asc"}]

Range

string

No

Filters the results by a specified range based on the maximum (Max) and minimum (Min) values of a field. The value is a JSON array. Example: [{"Field":"ScanSize","Min":"1000000","Max":"10000000"},{"Field":"QueryTime","Min":"1000","Max":"10000"}].

The Field parameter specifies the field to filter by. Valid values:

  • ScanSize: the amount of scanned data. Unit: KB.

  • QueryTime: the execution duration. Unit: milliseconds (ms).

  • PeakMemoryUsage: the peak memory usage for executing the SQL statement. Unit: KB.

Note

Min specifies the minimum value of the query range (left operand). Max specifies the maximum value of the query range (right operand). The data type of both parameters is String.

[{"Field":"ScanSize","Min":"1000000","Max":"10000000"},{"Field":"QueryTime","Min":"1000","Max":"10000"}]

State

string

No

The query state. Valid values:

  • Successed: The query was successful.

  • Failed: The query failed.

Successed

Response elements

Element

Type

Description

Example

object

The list of parameters.

TotalCount

string

The total number of entries.

100

PageSize

string

The number of entries on the current page.

30

RequestId

string

The request ID.

D7559209-7EC3-41E1-8F78-156990******

PageNumber

string

The page number.

1

DBClusterId

string

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

am-bp1rqvm70uh2****

Items

object

SlowLogRecord

array<object>

The list of slow query log details.

object

The list of parameters.

HostAddress

string

The IP address of the client that is used to connect to the database.

172.16.**.**

ScanTime

integer

The total time consumed to scan data. This value is the sum of the time consumed by the TableScanNode tasks on all nodes. Unit: milliseconds (ms).

10

SQLText

string

The details of the SQL statement.

INSERT OVERWRITE INTO hdfs_import_external\nSELECT *\nFROM adb_hdfs_import_source

OutputSize

string

The amount of output data generated by the task. Unit: bytes.

0.009

PeakMemoryUsage

string

The peak memory usage for executing the SQL statement. Unit: KB.

431.447

State

string

The execution state of the SQL statement.

SUCCESSED

WallTime

integer

The total CPU time consumed by all operators in the query on all nodes. Unit: milliseconds (ms).

6100

ScanSize

string

The amount of scanned data. Unit: KB.

0.035

ExecutionStartTime

string

The start time of the execution. The time is in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2021-05-27T08:04:43Z

QueryTime

integer

The execution duration of the SQL statement. Unit: milliseconds (ms).

2344

ReturnRowCounts

integer

The number of rows returned.

1

ScanRows

integer

The number of rows scanned from the data source.

3

ParseRowCounts

integer

The number of rows parsed.

0

DBName

string

The name of the database.

adb_demo

PlanningTime

integer

The time consumed to generate the execution plan. Unit: milliseconds (ms).

12

QueueTime

integer

The amount of time that the query waited in a queue before execution. Unit: milliseconds (ms).

0

UserName

string

The username.

test

ProcessID

string

The process ID.

2021052716044317201616624903453******

Examples

Success response

JSON format

{
  "TotalCount": "100",
  "PageSize": "30",
  "RequestId": "D7559209-7EC3-41E1-8F78-156990******",
  "PageNumber": "1",
  "DBClusterId": "am-bp1rqvm70uh2****",
  "Items": {
    "SlowLogRecord": [
      {
        "HostAddress": "172.16.**.**",
        "ScanTime": 10,
        "SQLText": "INSERT OVERWRITE INTO hdfs_import_external\\nSELECT *\\nFROM adb_hdfs_import_source",
        "OutputSize": "0.009",
        "PeakMemoryUsage": "431.447",
        "State": "SUCCESSED",
        "WallTime": 6100,
        "ScanSize": "0.035",
        "ExecutionStartTime": "2021-05-27T08:04:43Z",
        "QueryTime": 2344,
        "ReturnRowCounts": 1,
        "ScanRows": 3,
        "ParseRowCounts": 0,
        "DBName": "adb_demo",
        "PlanningTime": 12,
        "QueueTime": 0,
        "UserName": "test",
        "ProcessID": "2021052716044317201616624903453******"
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

404 InvalidDBCluster.NotFound The DBClusterId provided does not exist in our records. The specified DBClusterId parameter does not exist. Make sure that the DBClusterId value is valid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.