Queries the details about slow query logs.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
clickhouse:DescribeSlowLogRecords | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
DBClusterId | string | Yes | 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**** |
StartTime | string | Yes | 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 |
EndTime | string | Yes | 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 |
PageSize | integer | No | The number of entries per page. Valid values:
| 30 |
PageNumber | integer | No | The page number. Pages start from page 1. Default value: 1. | 1 |
QueryDurationMs | integer | No | 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
Examples
Sample success responses
JSON
format
{
"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 code | Error code | Error message | Description |
---|---|---|---|
500 | InternalError | An error occurred while processing your request. | An error occurred while processing your request. |
503 | ServiceUnavailable | An 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 time | Summary of changes | Operation |
---|---|---|
2024-09-25 | API Description Update. The Error code has changed | View Change Details |