Queries the details of the slow query logs of a PolarDB cluster.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeSlowLogs |
The operation that you want to perform. Set the value to DescribeSlowLogs. |
RegionId | String | Yes | cn-hangzhou |
The region ID of the cluster. |
DBClusterId | String | Yes | pc-**************** |
The ID of the cluster. |
StartTime | String | Yes | 2021-05-01Z |
The beginning of the time range to query. Specify the time in the yyyy-MM-ddZ format. The time must be in UTC. |
EndTime | String | Yes | 2021-05-30Z |
The end of the time range to query. The end time must be later than the start time. The time span between the start time and the end time cannot exceed 31 days. Specify the time in the yyyy-MM-ddZ format. The time must be in UTC. |
DBName | String | No | PolarDB_MySQL |
The name of the database. |
PageSize | Integer | No | 30 |
The number of entries to return on each page. Valid values: 30 to 100. Default value: 30. |
PageNumber | Integer | No | 1 |
The number of the page to return. The value must be an integer that is greater than 0. Default value: 1. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
TotalRecordCount | Integer | 5 |
The total number of entries. |
PageRecordCount | Integer | 6 |
The number of SQL statements that are returned on the current page. |
EndTime | String | 2021-05-30Z |
The end date of the time range that was queried. |
RequestId | String | 2553A660-E4EB-4AF4-A402-8AFF70A49143 |
The ID of the request. |
PageNumber | Integer | 3 |
The page number of the returned page. |
StartTime | String | 2021-05-01Z |
The start date of the time range that was queried. |
DBClusterId | String | pc-**************** |
The ID of the cluster. |
Items | Array of SQLSlowLog |
Details about slow queries. |
|
SQLSlowLog | |||
SQLText | String | select id,name from tb_table |
The SQL statement. |
ReturnMaxRowCount | Long | 3 |
The largest number of rows that were returned by a specific SQL statement in the query. |
CreateTime | String | 2021-05-30Z |
The date when the data was generated. |
MaxExecutionTime | Long | 60 |
The longest execution duration of a specific SQL statement in the query. Unit: seconds. |
ParseTotalRowCounts | Long | 2 |
The total number of rows that were parsed by all SQL statements in the query. |
TotalLockTimes | Long | 1 |
The total lock duration that was caused by all SQL statements in the query. Unit: seconds. |
TotalExecutionTimes | Long | 2 |
The total duration that was caused by all SQL statements in the query. Unit: seconds. |
DBNodeId | String | pi-*************** |
The ID of the node. |
SQLHASH | String | U2FsdGVkxxxx |
The unique ID of the SQL statement. The ID is used to obtain the slow query logs of the SQL statement. |
ParseMaxRowCount | Long | 1 |
The largest number of rows that were parsed by a specific SQL statement in the query. |
MaxLockTime | Long | 1 |
The longest lock duration that was caused by a specific SQL statement in the query. Unit: seconds. |
ReturnTotalRowCounts | Long | 1 |
The total number of rows that were returned by all SQL statements in the query. |
DBName | String | PolarDB_MySQL |
The name of the database. |
TotalExecutionCounts | Long | 2 |
The total number of executions the SQL statements. |
Engine | String | polardb_mysql |
The database engine. |
Examples
Sample requests
http(s)://polardb.aliyuncs.com/?Action=DescribeSlowLogs
&RegionId=cn-hangzhou
&DBClusterId=pc-****************
&StartTime=2021-05-01Z
&EndTime=2021-05-30Z
&DBName=PolarDB_MySQL
&PageSize=30
&PageNumber=1
&<Common request parameters>
Sample responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeSlowLogsResponse>
<TotalRecordCount>5</TotalRecordCount>
<PageRecordCount>6</PageRecordCount>
<EndTime>2021-05-30Z</EndTime>
<RequestId>2553A660-E4EB-4AF4-A402-8AFF70A49143</RequestId>
<PageNumber>3</PageNumber>
<StartTime>2021-05-01Z</StartTime>
<DBClusterId>pc-****************</DBClusterId>
<Items>
<SQLText>select id,name from tb_table</SQLText>
<ReturnMaxRowCount>3</ReturnMaxRowCount>
<CreateTime>2021-05-30Z</CreateTime>
<MaxExecutionTime>60</MaxExecutionTime>
<ParseTotalRowCounts>2</ParseTotalRowCounts>
<TotalLockTimes>1</TotalLockTimes>
<TotalExecutionTimes>2</TotalExecutionTimes>
<DBNodeId>pi-***************</DBNodeId>
<SQLHASH>U2FsdGVkxxxx</SQLHASH>
<ParseMaxRowCount>1</ParseMaxRowCount>
<MaxLockTime>1</MaxLockTime>
<ReturnTotalRowCounts>1</ReturnTotalRowCounts>
<DBName>PolarDB_MySQL</DBName>
<TotalExecutionCounts>2</TotalExecutionCounts>
</Items>
<Engine>polardb_mysql</Engine>
</DescribeSlowLogsResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"TotalRecordCount" : 5,
"PageRecordCount" : 6,
"EndTime" : "2021-05-30Z",
"RequestId" : "2553A660-E4EB-4AF4-A402-8AFF70A49143",
"PageNumber" : 3,
"StartTime" : "2021-05-01Z",
"DBClusterId" : "pc-****************",
"Items" : [ {
"SQLText" : "select id,name from tb_table",
"ReturnMaxRowCount" : 3,
"CreateTime" : "2021-05-30Z",
"MaxExecutionTime" : 60,
"ParseTotalRowCounts" : 2,
"TotalLockTimes" : 1,
"TotalExecutionTimes" : 2,
"DBNodeId" : "pi-***************",
"SQLHASH" : "U2FsdGVkxxxx",
"ParseMaxRowCount" : 1,
"MaxLockTime" : 1,
"ReturnTotalRowCounts" : 1,
"DBName" : "PolarDB_MySQL",
"TotalExecutionCounts" : 2
} ],
"Engine" : "polardb_mysql"
}
Error codes
For a list of error codes, visit the API Error Center.