All Products
Search
Document Center

Database Autonomy Service:GetPfsSqlSummaries

Last Updated:Jan 06, 2026

Queries the full request data generated by the new version of the performance insight feature of a database instance based on the SQL ID.

Operation description

Before you call this operation, take note of the following items:

  • If you use an Alibaba Cloud SDK or a Database Autonomy Service (DAS) SDK to call this API operation, we recommend that you use the latest version of the SDK.

  • If you use an SDK to call API operations of DAS, you must set the region ID to cn-shanghai.

  • An ApsaraDB RDS for MySQL instance or a PolarDB for MySQL cluster is connected to DAS.

  • The new version of the performance insight feature is enabled for the database instance. For more information, see Performance insight (new version).

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

hdm:GetPfsSqlSummaries

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

No

The instance ID.

rm-uf61swc4cru0b****

NodeId

string

No

The node ID.

Note

This parameter is required if the database instance is an ApsaraDB RDS for MySQL Cluster Edition instance or a PolarDB for MySQL cluster.

r-****-db-0

SqlId

string

No

The SQL ID.

Note

If this parameter is specified, the full request statistics of the specified SQL query are collected. If this parameter is left empty, the full request statistics of the entire database instance are collected.

651b56fe9418d48edb8fdf0980ec****

Keywords

string

No

The keywords of the SQL template. Separate multiple keywords with spaces.

select update

StartTime

integer

No

The beginning of the time range to query. Set this parameter to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1675833788056

EndTime

integer

No

The end of the time range to query. Set this parameter to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

Note

The end time must be later than the start time. You can view the data of up to seven days within the last month.

1679297005999

OrderBy

string

No

The field by which to sort the returned entries. Default value: count.

  • count: the number of executions.

  • avgRt: the average execution duration.

  • rtRate: the execution duration percentage.

  • rowsExamined: the total number of scanned rows.

  • avgRowsExamined: the average number of scanned rows.

  • avgRowsReturned: the average number of returned rows.

count

Asc

boolean

No

Specifies whether to sort the returned entries in ascending order. Default value: false. Valid values:

  • true

  • false

false

PageNo

integer

No

The page number. Pages start from page 1. Default value: 1.

1

PageSize

integer

No

The number of entries per page. Default value: 10. Valid values: 1 to 100.

10

Response elements

Element

Type

Description

Example

object

ListResult

Message

string

The returned message.

Note

If the request was successful, Successful is returned. If the request failed, an error message such as an error code is returned.

Successful

RequestId

string

The request ID.

54F3DBAE-9420-511A-9C29-265E8C04****

Data

object

The returned data.

Total

integer

The total number of entries returned.

264

List

array<object>

The details of the data returned.

object

The details of the data returned.

UserId

string

The user ID.

196278346919****

Psql

string

The SQL template.

select ?

InstanceId

string

The instance ID.

rm-2ze8g2am97624****

NodeId

string

The node ID.

Note

This parameter is returned only if the database instance is an ApsaraDB RDS for MySQL Cluster Edition instance or a PolarDB for MySQL cluster.

r-x****-db-0

SqlType

string

The type of the SQL statement. Valid values:

  • SELECT

  • UPDATE

  • DELETE

SELECT

LogicId

integer

The logical database ID.

58275984

SqlId

string

The SQL template ID.

2e8147b5ca2dfc640dfd5e43d96a****

Timestamp

integer

The data timestamp. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1643040000000

RtRate

number

The execution duration percentage.

0.1384

CountRate

number

The percentage of the number of executions.

0.0586

FullScan

boolean

Indicates whether full table scan was enabled. Valid values:

  • true

  • false

true

Count

integer

The total number of executions.

100000

ErrCount

integer

The number of errors.

0

WarnCount

integer

The number of warnings.

0

TotalLatency

number

The execution latency. Unit: millisecond.

60913.256

MaxLatency

number

The maximum execution latency. Unit: millisecond.

36.233

AvgLatency

number

The average execution latency. Unit: millisecond.

0.1717

RowsSent

integer

The number of rows returned by the SQL statement.

0

RowsSendAvg

number

The average number of returned rows.

0

RowsExamined

integer

The total number of scanned rows.

100

RowsExaminedAvg

number

The average number of scanned rows.

0

RowsAffected

integer

The number of rows that are affected by the SQL statement.

0

RowsAffectedAvg

number

The average number of rows affected by the SQL statement.

0

TmpTables

integer

The number of temporary tables.

0

TmpDiskTables

integer

The number of on-disk temporary tables.

0

RowsSorted

integer

The number of sorted rows.

0

SortMergePasses

integer

The number of merges that the sorting algorithm must perform.

0

PhysicalReads

integer

The number of physical nodes.

0

PhysicalAsyncReads

integer

The number of physical asynchronous nodes.

0

SemisyncDelayTime

number

The semi-synchronous replication latency. Unit: millisecond.

0.12

RowsSentAvg

number

The average number of rows returned for the SQL statement.

0.52

LogicReads

integer

The number of logical nodes.

0

RedoWrites

integer

The number of redo nodes.

0

DataWriteTime

number

The data write duration. Unit: millisecond.

0

DataWrites

integer

The number of nodes to which data can be written.

0

DataReadTime

number

The data read duration. Unit: millisecond.

0

DataReads

integer

The number of nodes from which data can be read.

0

RwlockOsWaits

integer

Indicates whether read/write splitting was enabled. Valid values:

  • 0: Read/write splitting was disabled.

  • 1: Read/write splitting was enabled.

0

RwlockSpinRounds

integer

The read/write splitting parameters.

0

RwlockSpinWaits

integer

Indices whether multi-index scanning was enabled. Valid values:

  • 0: Multi-index scanning was disabled.

  • 1: Multi-index scanning was enabled.

0

MutexWaits

integer

The number of mutex waits.

1

MutexSpins

integer

The number of mutex spins.

1

TransactionLockTime

number

The amount of time consumed for locking the storage transaction. Unit: millisecond.

0

ServerLockTime

number

The amount of time consumed for locking the server. Unit: millisecond.

0

CpuTime

number

The CPU execution duration. Unit: millisecond.

0

ElapsedTime

number

The execution duration. Unit: millisecond.

0

Id

integer

The primary key ID.

26186357

SelectScanAvg

number

The average number of scanned rows.

0

SelectRangeAvg

number

The average selected range.

0

SelectFullJoinAvg

number

The average number of joins that performed table scans without using indexes.

Note

If the value of this parameter is not 0, check the table indexes.

0

SelectFullRangeJoinAvg

number

The average number of joins that selected a range.

0

SortScanAvg

number

The average number of sorts that were performed during table scans.

0

SortRowsAvg

number

The average number of sorted rows.

0

TmpTablesAvg

number

The average number of temporary tables.

0

TmpDiskTablesAvg

number

The average number of on-disk temporary tables.

0

FirstTime

integer

The time when the SQL statement was executed for the first time. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1659308149000

LastTime

integer

The time when the SQL statement was last modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1661306520000

LockLatencyAvg

number

The average lock wait latency. Unit: millisecond.

0

TimerWaitAvg

number

The reserved parameter.

None

SortRangeAvg

number

The average number of sorts that were performed by using a range.

0

CpuRate

number

The ratio of the CPU execution duration to the total execution duration of the SQL statement.

0

Db

string

The name of the database.

testDB

Tables

array

The names of tables in the database.

string

The names of tables in the database.

test_table

PageNo

integer

The page number.

1

PageSize

integer

The number of entries per page.

10

Extra

any

The reserved parameter.

None

Code

integer

The HTTP status code returned.

200

Success

boolean

Indicates whether the request was successful. Valid values:

  • true

  • false

true

Examples

Success response

JSON format

{
  "Message": "Successful",
  "RequestId": "54F3DBAE-9420-511A-9C29-265E8C04****",
  "Data": {
    "Total": 264,
    "List": [
      {
        "UserId": "196278346919****",
        "Psql": "select ?",
        "InstanceId": "rm-2ze8g2am97624****",
        "NodeId": "r-x****-db-0",
        "SqlType": "SELECT",
        "LogicId": 58275984,
        "SqlId": "2e8147b5ca2dfc640dfd5e43d96a****",
        "Timestamp": 1643040000000,
        "RtRate": 0.1384,
        "CountRate": 0.0586,
        "FullScan": true,
        "Count": 100000,
        "ErrCount": 0,
        "WarnCount": 0,
        "TotalLatency": 60913.256,
        "MaxLatency": 36.233,
        "AvgLatency": 0.1717,
        "RowsSent": 0,
        "RowsSendAvg": 0,
        "RowsExamined": 100,
        "RowsExaminedAvg": 0,
        "RowsAffected": 0,
        "RowsAffectedAvg": 0,
        "TmpTables": 0,
        "TmpDiskTables": 0,
        "RowsSorted": 0,
        "SortMergePasses": 0,
        "PhysicalReads": 0,
        "PhysicalAsyncReads": 0,
        "SemisyncDelayTime": 0.12,
        "RowsSentAvg": 0.52,
        "LogicReads": 0,
        "RedoWrites": 0,
        "DataWriteTime": 0,
        "DataWrites": 0,
        "DataReadTime": 0,
        "DataReads": 0,
        "RwlockOsWaits": 0,
        "RwlockSpinRounds": 0,
        "RwlockSpinWaits": 0,
        "MutexWaits": 1,
        "MutexSpins": 1,
        "TransactionLockTime": 0,
        "ServerLockTime": 0,
        "CpuTime": 0,
        "ElapsedTime": 0,
        "Id": 26186357,
        "SelectScanAvg": 0,
        "SelectRangeAvg": 0,
        "SelectFullJoinAvg": 0,
        "SelectFullRangeJoinAvg": 0,
        "SortScanAvg": 0,
        "SortRowsAvg": 0,
        "TmpTablesAvg": 0,
        "TmpDiskTablesAvg": 0,
        "FirstTime": 1659308149000,
        "LastTime": 1661306520000,
        "LockLatencyAvg": 0,
        "TimerWaitAvg": 0,
        "SortRangeAvg": 0,
        "CpuRate": 0,
        "Db": "testDB",
        "Tables": [
          "test_table"
        ]
      }
    ],
    "PageNo": 1,
    "PageSize": 10,
    "Extra": "None"
  },
  "Code": 200,
  "Success": true
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParams The request parameters are invalid.
403 NoPermission You are not authorized to do this action.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.