All Products
Search
Document Center

ApsaraDB for ClickHouse:DescribeSlowLogRecords

Last Updated:Dec 03, 2025

The DescribeSlowLogRecords operation queries the details of slow query logs.

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

clickhouse:DescribeSlowLogRecords

list

*EnterpriseDBCluster

acs:clickhouse:{#regionId}:{#accountId}:enterprisedbcluster/{#DBInstanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The region ID.

cn-hangzhou

DBInstanceId

string

Yes

The cluster ID.

cc-bp100p4q1g9z3****

StartTime

string

No

The start of the time range to query. The time is in the yyyy-MM-dd hh:mm:ss format and is displayed in UTC.

2023-09-11 16:00:00

EndTime

string

No

The end of the time range to query. The time is in the yyyy-MM-dd hh:mm:ss format and is displayed in UTC.

2023-09-15 16:00:00

QueryDurationMs

string

No

The execution duration of the slow query. The minimum value is 1000. The unit is milliseconds.

3000

PageSize

integer

No

The number of entries to return on each page. Valid values:

  • 30 (default)

  • 50

  • 100

30

PageNumber

integer

No

The page number.

1

ComputingGroupId

string

No

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

DF203CC8-5F68-5E3F-8050-3C77DD65731A

Data

object

The returned data.

DBInstanceID

integer

The cluster ID.

cc-bp100p4q1g9z32****

DBInstanceName

string

The cluster name.

集群测试

TotalCount

integer

The total number of entries.

1

ResultSet

array<object>

The result set.

object

The result set.

QueryStartTime

string

The start time of the query. The time is in the yyyy-MM-dd hh:mm:ss format and is displayed in UTC.

2023-09-11 16:00:00

InitialQueryId

string

The query ID.

'ae915a3ad30e77e67a7215d05b658cc6'

ReadRows

integer

The number of rows read.

10

InitialAddress

string

The source address of the query.

0:0:0:0:0:ffff:1edd65ea

Query

string

The queried statement.

select * from test

MemoryUsage

integer

The peak memory usage for the query. Unit: bytes.

4941696

Type

string

The type of the slow query log.

ExceptionWhileProcessing

ReadBytes

integer

The size of the scanned data. Unit: bytes.

4507128020832

InitialUser

string

The user who initiated the query.

bany

QueryDurationMs

integer

The execution duration of the slow query. The minimum value is 1000. The unit is milliseconds.

3000

ResultBytes

integer

The size of the result data. Unit: bytes.

10

Examples

Success response

JSON format

{
  "RequestId": "DF203CC8-5F68-5E3F-8050-3C77DD65731A",
  "Data": {
    "DBInstanceID": 0,
    "DBInstanceName": "集群测试",
    "TotalCount": 1,
    "ResultSet": [
      {
        "QueryStartTime": "2023-09-11 16:00:00",
        "InitialQueryId": "'ae915a3ad30e77e67a7215d05b658cc6'",
        "ReadRows": 10,
        "InitialAddress": "0:0:0:0:0:ffff:1edd65ea",
        "Query": "select * from test",
        "MemoryUsage": 4941696,
        "Type": "ExceptionWhileProcessing",
        "ReadBytes": 4507128020832,
        "InitialUser": "bany",
        "QueryDurationMs": 3000,
        "ResultBytes": 10
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.