All Products
Search
Document Center

ApsaraDB for ClickHouse:DescribeSlowLogRecords

Last Updated:Mar 01, 2024

Queries the details about slow query logs.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

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. The minimum value is 1000, and the default value is 1000. Unit: milliseconds. Queries that last longer than this 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.

TableSchemaobject []

The schema of the table in the database.

Typestring

The type of the column.

String
Namestring

The name of the column.

name
Dataobject []

Details about the slow query logs.

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
No change history