Queries the details of slow SQL statements on compute nodes and storage nodes of a PolarDB-X instance.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
polardbx:DescribeSlowLogRecords |
list |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| PageSize |
integer |
No |
The number of entries per page. Default value: 100. Limit: A maximum of 100 entries can be returned at a time. |
30 |
| Page |
integer |
No |
The page number. Default value: 1. |
1 |
| StartTime |
string |
Yes |
The start time of the query. Format: YYYY-MM-ddTHH:mmZ (UTC). |
2024-10-09T02:26 |
| EndTime |
string |
Yes |
The start time of the query. Format: YYYY-MM-ddTHH:mmZ (UTC). |
2024-11-22T02:22Z |
| DBInstanceName |
string |
Yes |
The instance name. |
pxc-bjxxxxxxxx |
| DBNodeIds |
string |
No |
The node IDs. You can specify multiple node IDs separated by commas ( |
pxc-i-mezcj4ejdz |
| CharacterType |
string |
Yes |
The node type. Valid values:
|
polarx_cn |
| RegionId |
string |
Yes |
The region ID of the instance. |
cn-hangzhou |
| DBName |
string |
No |
The database name. |
testdb |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
Id of the request |
C458B1E8-1683-3645-B154-6BA32080EEA |
| DBInstanceId |
string |
The instance ID. |
pxc-******** |
| PageNumber |
string |
The page number of the current query. |
1 |
| PageRecordCount |
string |
The number of entries per page. |
30 |
| TotalCount |
string |
The total number of entries. |
3 |
| Items |
array<object> |
The list of slow log details. |
|
|
object |
The list of slow log details. |
||
| SQLHash |
string |
The unique identity of the SQL statement in slow query log statistics. |
c8df07e5d45cd68da8b4771c2016e20b |
| SQLText |
string |
The SQL statement. |
select * from test |
| QueryStartTime |
string |
The timestamp. Format: YYYY-MM-ddTHH:mm.ss.SSSZ (UTC).
|
2024-11-22T02:22:22.444Z |
| QueryTime |
string |
The execution duration of the SQL statement. Unit: seconds (s). |
3.000 |
| QueryTimeMS |
string |
The execution duration of the SQL statement. Unit: milliseconds (ms). |
3000.000 |
| LockTimeMS |
string |
The lock duration. Unit: milliseconds (ms). This field is available only for DN. |
1 |
| ParseRowCounts |
string |
The number of rows scanned. This field is available only for DN. |
10 |
| ReturnRowCounts |
string |
The number of rows returned. This field is available only for DN. |
20 |
| HostAddress |
string |
The client name and address that connects to the database. |
****[****] @ [1XX.XX.XX.XX] |
| DBName |
string |
The database name. |
dcdev |
| CNname |
string |
The compute node name. This field is available only for CN. |
pxc-i-xxxx |
| Extension |
string |
The extension field. This field is available only for CN. |
tddl:5.4.19-20240927 |
| Fail |
string |
Indicates whether the execution failed. This field is available only for CN. Valid values:
|
0 |
| InsName |
string |
The instance name. This field is available only for DN. |
pxc-xdb-s-xxxx |
| IsBind |
string |
Indicates whether the Prepare mode is used. This field is available only for CN. Valid values:
|
0 |
| WT |
string |
The workload type. This field is available only for CN. Valid values:
|
TP |
| Params |
string |
The parameters in Prepare mode. This field is available only for CN. |
["1"] |
| Frows |
string |
The number of rows fetched. This field is available only for CN. |
1 |
| Rows |
string |
The number of rows affected or returned. This field is available only for CN. |
1 |
| SCNT |
string |
The number of physical SQL statements. This field is available only for CN. |
1 |
| SqlType |
string |
The SQL type. This field is available only for CN. |
select |
| TooLong |
string |
Indicates whether the SQL statement is too long. This field is available only for CN. Valid values:
|
0 |
| TraceId |
string |
The trace ID. This field is available only for CN. |
17a5c5c840006000 |
| TransactionPolicy |
string |
The transaction policy. This field is available only for CN. |
XA |
| TrxId |
string |
The transaction ID. This field is available only for CN. |
17a5c5c840006000 |
| TemplateId |
string |
The kernel template ID. This field is available only for CN. |
af33ffee |
Examples
Success response
JSON format
{
"RequestId": "C458B1E8-1683-3645-B154-6BA32080EEA",
"DBInstanceId": "pxc-********",
"PageNumber": "1",
"PageRecordCount": "30",
"TotalCount": "3",
"Items": [
{
"SQLHash": "c8df07e5d45cd68da8b4771c2016e20b",
"SQLText": "select * from test ",
"QueryStartTime": "2024-11-22T02:22:22.444Z",
"QueryTime": "3.000",
"QueryTimeMS": "3000.000",
"LockTimeMS": "1",
"ParseRowCounts": "10",
"ReturnRowCounts": "20",
"HostAddress": "****[****] @ [1XX.XX.XX.XX]\n",
"DBName": "dcdev",
"CNname": "pxc-i-xxxx",
"Extension": "tddl:5.4.19-20240927",
"Fail": "0",
"InsName": "pxc-xdb-s-xxxx",
"IsBind": "0",
"WT": "TP",
"Params": "[\"1\"]",
"Frows": "1",
"Rows": "1",
"SCNT": "1",
"SqlType": "select",
"TooLong": "0",
"TraceId": "17a5c5c840006000",
"TransactionPolicy": "XA",
"TrxId": "17a5c5c840006000",
"TemplateId": "af33ffee"
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidStartTime.Malformed | The specified parameter StartTime is not valid. | english description1 |
| 400 | InvalidDBInstance.NotFound | The specified DB instance does not exist or is not supported. | english description1 |
| 404 | InvalidDBInstanceId.NotFound | The specified DBInstanceId does not exist. | The instance ID does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.