All Products
Search
Document Center

ApsaraDB for ClickHouse:DescribeSlowLogRecords

Last Updated:Nov 12, 2024

Queries the details about slow query logs.

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:
    • 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
clickhouse:DescribeSlowLogRecordsget
  • DBCluster
    acs:clickhouse:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
DBClusterIdstringYes

The cluster ID. You can call the DescribeDBClusters operation to query information about all the clusters that are deployed in a specific region. The information includes the cluster IDs.

cc-bp1z58t881wcx****
StartTimestringYes

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-dd hh:mm:ss format. The time must be in Coordinated Universal Time (UTC).

2022-05-20 16:00:00
EndTimestringYes

The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-dd hh:mm:ss format. The time must be in UTC.

Note The end time must be later than the start time. The specified time range that can be specified must be less than seven days.
2022-05-27 16:00:00
PageSizeintegerNo

The number of entries per page. Valid values:

  • 30 (default)
  • 50
  • 100
30
PageNumberintegerNo

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

1
QueryDurationMsintegerNo

The minimum query duration. Minimum value: 1000. Default value: 1000. Unit: milliseconds. Queries that last longer than the specified duration are returned in response parameters.

1000

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

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

The details about the slow query logs.

TableSchemaarray<object>

The schema of the table in the database.

ResultSetobject
Typestring

The type of the column.

String
Namestring

The name of the column.

name
Dataarray<object>

Details about the slow query logs.

ResultSetobject
Typestring

The query status. Valid values:

  • QueryFinish: The query is complete.
  • Processing: The query is running.
QueryFinish
QueryStartTimestring

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

2022-05-22 20:00:01
Querystring

The statement that was executed in the query.

Select * from table
ReadRowsstring

The number of rows read by executing the statement.

10027008
InitialAddressstring

The IP address of the client that initiated the query.

::ffff:100.104.XX.XX
MemoryUsagestring

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

1048576
InitialUserstring

The username that is used to initiate the query.

test_users
InitialQueryIdstring

The query ID.

'b51496f2-6b0b-4546-aff9-e17951cb9410'
ReadBytesstring

The size of the data read by executing the statement. Unit: bytes.

1048576
QueryDurationMsstring

The duration of the query. Unit: milliseconds.

2000
ResultBytesstring

The size of the result data. Unit: bytes.

1024
Rowsstring

The number of rows in the result set.

1
RowsBeforeLimitAtLeaststring

The number of entries per page.

1
Statisticsobject

The statistics of the results.

RowsReadinteger

The total number of rows that were read.

2016722
ElapsedTimefloat

The time consumed by the slow query. Unit: milliseconds.

21.35
BytesReadinteger

The total size of data that were read. Unit: bytes.

123456

Examples

Sample success responses

JSONformat

{
  "RequestId": "DF203CC8-5F68-5E3F-8050-3C77DD65731A",
  "SlowLogRecords": {
    "TableSchema": {
      "ResultSet": [
        {
          "Type": "String",
          "Name": "name"
        }
      ]
    },
    "Data": {
      "ResultSet": [
        {
          "Type": "QueryFinish",
          "QueryStartTime": "2022-05-22 20:00:01",
          "Query": "Select * from table",
          "ReadRows": "10027008",
          "InitialAddress": "::ffff:100.104.XX.XX",
          "MemoryUsage": "1048576",
          "InitialUser": "test_users",
          "InitialQueryId": "'b51496f2-6b0b-4546-aff9-e17951cb9410'",
          "ReadBytes": "1048576",
          "QueryDurationMs": "2000",
          "ResultBytes": "1024"
        }
      ]
    },
    "Rows": "1",
    "RowsBeforeLimitAtLeast": "1",
    "Statistics": {
      "RowsRead": 2016722,
      "ElapsedTime": 21.35,
      "BytesRead": 123456
    }
  }
}

Error codes

HTTP status codeError codeError messageDescription
500InternalErrorAn error occurred while processing your request.An error occurred while processing your request.
503ServiceUnavailableAn error occurred while processing your request.An error occurred while processing your request.

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

Change history

Change timeSummary of changesOperation
2024-09-25API Description Update. The Error code has changedView Change Details