All Products
Search
Document Center

DescribeSlowLogRecords

Last Updated: Aug 05, 2020

Queries slow query logs of an AnalyticDB for MySQL cluster.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeSlowLogRecords The operation that you want to perform. Set the value to

DescribeSlowLogRecords.

DBClusterId String Yes rm-uf6wjk5xxxxxxxxxx The ID of the cluster whose slow query logs are to be queried.
StartTime String Yes 2019-06-01T16:05:00Z The beginning of the time range to query. The time must be in UTC. Format: yyyy-MM-ddTHH:mm:ssZ
EndTime String Yes 2019-06-20T16:05:00Z 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 end time must be less than seven days.

The time must be in UTC. Format: yyyy-MM-ddTHH:mm:ssZ

DBName String No test_db The name of the database.
PageSizeIntegerYes30The number of entries to return on each page. Valid values:
  • 30
  • 50
  • 100
Default value: 30
PageNumberIntegerYes1The number of the page to return. Valid values: any positive integer Default value: 1

Response parameters

ParameterTypeExampleDescription
TotalCountInteger100The total number of entries returned.
PageNumberInteger1The page number of the page returned.
PageSizeInteger2The total number of pages returned.
Items-The details about a slow query log.
└HostAddressString192.101.2.11The IP address of the client used to connect to the database.
└DBNameStringtest_databaseThe name of the database.
└SQLTextStringselect count(*) from test where name = ‘8’The slow query statement that was executed.
└QueryTimeLong12The time taken to execute the slow query statement. Unit: milliseconds
└ParseRowCountsLong24The number of rows parsed by the slow query statement.
└ReturnRowCountsLong123The number of rows returned.
└ExecutionStartTimeString2019-06-01T16:00ZThe time when the execution of the slow query statement started. The time must be in UTC. Format: yyyy-MM-ddTHH:mm:ssZ
DBClusterIdStringrm-uf6wjk5xxxxxxxxxxThe ID of the cluster.
RequestIdString1AD222E9-E606-4A42-BF6D-8A4442913CEFThe ID of the request.

Examples

Sample requests

  1. http(s)://[Endpoint]/?Action=DescribeSlowLogRecords
  2. &DBClusterId=am-uf6wjk5xxxxxxx
  3. &StartTime=2011-06-01T16:00:00Z
  4. &EndTime=2011-06-20T16:00:00Z
  5. &<Common request parameters>

Sample success responses

XML format

  1. <DescribeSlowLogRecordsResponse>
  2. <Items>
  3. <SlowLogRecord>
  4. <ReturnRowCounts>0</ReturnRowCounts>
  5. <HostAddress>127.0.0.1:19993</HostAddress>
  6. <SQLText>select count(*) from test</SQLText>
  7. <QueryTime>14</QueryTime>
  8. <ExecutionStartTime>2019-07-24T06:45:30Z</ExecutionStartTime>
  9. <UserName>testuser</UserName>
  10. <ParseRowCounts>20</ParseRowCounts>
  11. <ProcessID>2019072414453017202111115703151073521</ProcessID>
  12. <DBName>testdb</DBName>
  13. </SlowLogRecord>
  14. <SlowLogRecord>
  15. <ReturnRowCounts>0</ReturnRowCounts>
  16. <HostAddress>127.0.0.1:19993</HostAddress>
  17. <SQLText>select count(*) from test where name = '8'</SQLText>
  18. <QueryTime>16</QueryTime>
  19. <ExecutionStartTime>2019-07-24T06:45:29Z</ExecutionStartTime>
  20. <UserName>testuser</UserName>
  21. <ParseRowCounts>2</ParseRowCounts>
  22. <ProcessID>2019072414452917202111115703151073520</ProcessID>
  23. <DBName>testdb</DBName>
  24. </SlowLogRecord>
  25. </Items>
  26. <PageNumber>1</PageNumber>
  27. <TotalCount>46</TotalCount>
  28. <PageSize>30</PageSize>
  29. <RequestId>5C9036FF-2A62-4CB6-8922-E7C881CEF813</RequestId>
  30. <DBClusterId>am-uf6wjk5xxxxxxx</DBClusterId>
  31. </DescribeSlowLogRecordsResponse>

JSON format

  1. {
  2. "Items": {
  3. "SlowLogRecord": [
  4. {
  5. "ReturnRowCounts": 0,
  6. "HostAddress": "127.0.0.1:19993",
  7. "SQLText": "select count(*) from test",
  8. "QueryTime": 14,
  9. "ExecutionStartTime": "2019-07-24T06:45:30Z",
  10. "UserName": "testuser",
  11. "ParseRowCounts": 20,
  12. "ProcessID": "2019072414453017202111115703151073521",
  13. "DBName": "testdb"
  14. },
  15. {
  16. "ReturnRowCounts": 0,
  17. "HostAddress": "127.0.0.1:19993",
  18. "SQLText": "select count(*) from test where name = '8'",
  19. "QueryTime": 16,
  20. "ExecutionStartTime": "2019-07-24T06:45:29Z",
  21. "UserName": "testuser",
  22. "ParseRowCounts": 2,
  23. "ProcessID": "2019072414452917202111115703151073520",
  24. "DBName": "testdb"
  25. }
  26. ]
  27. },
  28. "PageNumber": 1,
  29. "TotalCount": 46,
  30. "PageSize": 30,
  31. "RequestId": "5C9036FF-2A62-4CB6-8922-E7C881CEF813",
  32. "DBClusterId": "am-uf6wjk5xxxxxxx"
  33. }