All Products
Search
Document Center

PolarDB:DescribeSlowLogRecords

Last Updated:Sep 10, 2026

Queries the details of slow SQL statements on compute nodes and storage nodes of a PolarDB-X instance.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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 (,). This parameter is required when you query storage nodes.

pxc-i-mezcj4ejdz

CharacterType

string

Yes

The node type.

Valid values:

  • polarx_dn :

    polarx_dn

  • polarx_cn :

    polarx_cn

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).

  • In CN slow logs, this field indicates the execution start time.

  • In DN slow logs, this field indicates the execution end time.

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 :

    0

  • 2 :

    2

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 :

    0

  • 1 :

    1

0

WT

string

The workload type. This field is available only for CN.

Valid values:

  • TP :

    TP

  • AP :

    AP

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 :

    0

  • 1 :

    1

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.