Queries the details of slow query logs of an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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 am-bp1rqvm70uh2****

The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

Note You can call the DescribeDBClusters operation to query the cluster IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a specific region.
StartTime String Yes 2021-05-20T16:00:00Z

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

EndTime String Yes 2021-05-27T16:00:00Z

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

Note The end time must be later than the start time. The specified time range must be less than seven days.
DBName String No adb_demo

The name of the database.

PageSize Integer No 30

The number of entries to return on each page. Valid values: 30, 50, and 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.

ProcessID String No 2021052716044317201616624903453******

The ID of the process.

Order String No [{"Field":"ExecutionStartTime","Type":"Desc"},{"Field":"ScanRows","Type":"Asc"}]

The order in which to sort the retrieved entries by field. Specify this parameter in the JSON format. The value is an ordered array that uses the order of the input array and contains Field and Type. Example: [{"Field":"ExecutionStartTime","Type":"Desc"},{"Field":"ScanRows","Type":"Asc"}].

  • Field: the field that is used to sort the retrieved entries. Valid values:
    • HostAddress: the IP address of the client that is used to connect to the database.
    • UserName: the username.
    • ExecutionStartTime: the start time of the query execution.
    • QueryTime: the amount of time consumed to execute the SQL statement.
    • PeakMemoryUsage: the maximum memory usage when the SQL statement is executed.
    • ScanRows: the number of rows to be scanned from a data source in the task.
    • ScanSize: the amount of data to be scanned.
    • ScanTime: the total amount of time consumed to scan data.
    • PlanningTime: the amount of time consumed to generate execution plans.
    • WallTime: the accumulated CPU Time values of all operators in the query on each node.
    • ProcessID: the ID of the process.
  • Type: the sorting type of the retrieved entries. Valid values:
    • Desc: descending order
    • Asc: ascending order
Range String No [{"Field":"ScanSize","Min":"1000000","Max":"10000000"},{"Field":"QueryTime","Min":"1000","Max":"10000"}]

The range conditions used to filter specified fields, including Max and Min. Specify this parameter in the JSON format. Example: [{"Field":"ScanSize","Min":"1000000","Max":"10000000"},{"Field":"QueryTime","Min":"1000","Max":"10000"}].

Field: the field to be filtered. Valid values:

  • ScanSize: the amount of data to be scanned. Unit: KB.
  • QueryTime: the amount of time consumed to execute the statement. Unit: milliseconds.
  • PeakMemoryUsage: the maximum memory usage when the SQL statement is executed. Unit: KB.
Note Min indicates the minimum value of the query range (left operand). Max indicates the maximum value of the query range (right operand). Max and Min are both of the String type.
State String No Successed

The state of the query. Valid values:

  • Successed: successful
  • Failed: failed

Response parameters

Parameter Type Example Description
TotalCount String 100

The total number of entries returned.

PageSize String 30

The number of entries returned on the current page.

RequestId String D7559209-7EC3-41E1-8F78-156990******

The ID of the request.

PageNumber String 1

The page number of the returned page.

DBClusterId String am-bp1rqvm70uh2****

The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

Items Array of SlowLogRecord

Details of the slow query logs.

SlowLogRecord
HostAddress String 172.16.**.**

The IP address of the client that is used to connect to the database.

ScanTime Long 10

The total amount of time consumed to scan data. It is an accumulated value collected from multiple TableScanNode nodes. Unit: milliseconds.

SQLText String INSERT OVERWRITE INTO hdfs_import_external\nSELECT *\nFROM adb_hdfs_import_source

Details of the SQL statement.

OutputSize String 0.009

The amount of output data in the task. Unit: bytes.

PeakMemoryUsage String 431.447

The maximum memory usage when the SQL statement is executed. Unit: KB.

State String SUCCESSED

The execution state of the SQL statement.

WallTime Long 6100

The accumulated CPU Time value of all operators collected from all nodes. Unit: milliseconds.

ScanSize String 0.035

The amount of scanned data. Unit: KB.

ExecutionStartTime String 2021-05-27T08:04:43Z

The time when the execution started. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

QueryTime Long 2344

The time consumed to execute the SQL statement. Unit: milliseconds.

ReturnRowCounts Long 1

The number of rows returned by the SQL statement.

ScanRows Long 3

The number of rows scanned from a data source in the task.

ParseRowCounts Long 0

The number of rows parsed by the SQL statement.

DBName String adb_demo

The name of the database.

PlanningTime Long 12

The amount of time consumed to generate execution plans. Unit: milliseconds.

QueueTime Long 0

The queuing duration before the query is executed. Unit: milliseconds.

UserName String test

The username.

ProcessID String 2021052716044317201616624903453******

The ID of the process.

Examples

Sample requests

http(s)://adb.aliyuncs.com/?Action=DescribeSlowLogRecords
&DBClusterId=am-bp1rqvm70uh2****
&StartTime=2021-05-20T16:00:00Z
&EndTime=2021-05-27T16:00:00Z
&DBName=adb_demo
&PageSize=30
&PageNumber=1
&ProcessID=2021052716044317201616624903453******
&Order=[{"Field":"ExecutionStartTime","Type":"Desc"},{"Field":"ScanRows","Type":"Asc"}]
&Range=[{"Field":"ScanSize","Min":"1000000","Max":"10000000"},{"Field":"QueryTime","Min":"1000","Max":"10000"}]
&State=Successed
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeSlowLogRecordsResponse>
    <TotalCount>100</TotalCount>
    <PageSize>30</PageSize>
    <RequestId>D7559209-7EC3-41E1-8F78-156990******</RequestId>
    <PageNumber>1</PageNumber>
    <DBClusterId>am-bp1rqvm70uh2****</DBClusterId>
    <Items>
        <HostAddress>172.16.**.**</HostAddress>
        <ScanTime>10</ScanTime>
        <SQLText>INSERT OVERWRITE INTO hdfs_import_external\nSELECT *\nFROM adb_hdfs_import_source</SQLText>
        <OutputSize>0.009</OutputSize>
        <PeakMemoryUsage>431.447</PeakMemoryUsage>
        <State>SUCCESSED</State>
        <WallTime>6100</WallTime>
        <ScanSize>0.035</ScanSize>
        <ExecutionStartTime>2021-05-27T08:04:43Z</ExecutionStartTime>
        <QueryTime>2344</QueryTime>
        <ReturnRowCounts>1</ReturnRowCounts>
        <ScanRows>3</ScanRows>
        <ParseRowCounts>0</ParseRowCounts>
        <DBName>adb_demo</DBName>
        <PlanningTime>12</PlanningTime>
        <QueueTime>0</QueueTime>
        <UserName>test</UserName>
        <ProcessID>2021052716044317201616624903453******</ProcessID>
    </Items>
</DescribeSlowLogRecordsResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TotalCount" : "100",
  "PageSize" : "30",
  "RequestId" : "D7559209-7EC3-41E1-8F78-156990******",
  "PageNumber" : "1",
  "DBClusterId" : "am-bp1rqvm70uh2****",
  "Items" : [ {
    "HostAddress" : "172.16.**.**",
    "ScanTime" : 10,
    "SQLText" : "INSERT OVERWRITE INTO hdfs_import_external\\nSELECT *\\nFROM adb_hdfs_import_source",
    "OutputSize" : "0.009",
    "PeakMemoryUsage" : "431.447",
    "State" : "SUCCESSED",
    "WallTime" : 6100,
    "ScanSize" : "0.035",
    "ExecutionStartTime" : "2021-05-27T08:04:43Z",
    "QueryTime" : 2344,
    "ReturnRowCounts" : 1,
    "ScanRows" : 3,
    "ParseRowCounts" : 0,
    "DBName" : "adb_demo",
    "PlanningTime" : 12,
    "QueueTime" : 0,
    "UserName" : "test",
    "ProcessID" : "2021052716044317201616624903453******"
  } ]
}

Error codes

HTTP status code Error code Error message Description
404 InvalidDBCluster.NotFound The DBClusterId provided does not exist in our records. The error message returned because the specified value for the DBClusterId parameter does not exist. Check whether the value is valid.

For a list of error codes, visit the API Error Center.