All Products
Search
Document Center

Database Autonomy Service:GetPfsSqlSummaries

Last Updated:Dec 23, 2024

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

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
hdm:GetPfsSqlSummariesget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringNo

The instance ID.

rm-uf61swc4cru0b****
NodeIdstringNo

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
SqlIdstringNo

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****
KeywordsstringNo

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

select update
StartTimelongNo

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
EndTimelongNo

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
OrderBystringNo

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
AscbooleanNo

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

  • true
  • false
false
PageNointegerNo

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

1
PageSizeintegerNo

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

10

Response parameters

ParameterTypeDescriptionExample
object

ListResult

Messagestring

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
RequestIdstring

The request ID.

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

The returned data.

Totallong

The total number of entries returned.

264
Listarray<object>

The details of the data returned.

Listobject

The details of the data returned.

UserIdstring

The user ID.

196278346919****
Psqlstring

The SQL template.

select ?
InstanceIdstring

The instance ID.

rm-2ze8g2am97624****
NodeIdstring

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
SqlTypestring

The type of the SQL statement. Valid values:

  • SELECT
  • UPDATE
  • DELETE
SELECT
LogicIdlong

The logical database ID.

58275984
SqlIdstring

The SQL template ID.

2e8147b5ca2dfc640dfd5e43d96a****
Timestamplong

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
RtRatedouble

The execution duration percentage.

0.1384
CountRatedouble

The percentage of the number of executions.

0.0586
FullScanboolean

Indicates whether full table scan was enabled. Valid values:

  • true
  • false
true
Countlong

The total number of executions.

100000
ErrCountlong

The number of errors.

0
WarnCountlong

The number of warnings.

0
TotalLatencydouble

The execution latency. Unit: millisecond.

60913.256
MaxLatencydouble

The maximum execution latency. Unit: millisecond.

36.233
AvgLatencydouble

The average execution latency. Unit: millisecond.

0.1717
RowsSentlong

The number of rows returned by the SQL statement.

0
RowsSendAvgdouble

The average number of returned rows.

0
RowsExaminedlong

The total number of scanned rows.

100
RowsExaminedAvgdouble

The average number of scanned rows.

0
RowsAffectedlong

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

0
RowsAffectedAvgdouble

The average number of rows affected by the SQL statement.

0
TmpTableslong

The number of temporary tables.

0
TmpDiskTableslong

The number of on-disk temporary tables.

0
RowsSortedlong

The number of sorted rows.

0
SortMergePasseslong

The number of merges that the sorting algorithm must perform.

0
PhysicalReadslong

The number of physical nodes.

0
PhysicalAsyncReadslong

The number of physical asynchronous nodes.

0
SemisyncDelayTimedouble

The semi-synchronous replication latency. Unit: millisecond.

0.12
RowsSentAvgdouble

The average number of rows returned for the SQL statement.

0.52
LogicReadslong

The number of logical nodes.

0
RedoWriteslong

The number of redo nodes.

0
DataWriteTimedouble

The data write duration. Unit: millisecond.

0
DataWritesinteger

The number of nodes to which data can be written.

0
DataReadTimedouble

The data read duration. Unit: millisecond.

0
DataReadsinteger

The number of nodes from which data can be read.

0
RwlockOsWaitsinteger

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

  • 0: Read/write splitting was disabled.
  • 1: Read/write splitting was enabled.
0
RwlockSpinRoundsinteger

The read/write splitting parameters.

0
RwlockSpinWaitsinteger

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

  • 0: Multi-index scanning was disabled.
  • 1: Multi-index scanning was enabled.
0
MutexWaitsinteger

The number of mutex waits.

1
MutexSpinsinteger

The number of mutex spins.

1
TransactionLockTimedouble

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

0
ServerLockTimedouble

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

0
CpuTimedouble

The CPU execution duration. Unit: millisecond.

0
ElapsedTimedouble

The execution duration. Unit: millisecond.

0
Idlong

The primary key ID.

26186357
SelectScanAvgdouble

The average number of scanned rows.

0
SelectRangeAvgdouble

The average selected range.

0
SelectFullJoinAvgdouble

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
SelectFullRangeJoinAvgdouble

The average number of joins that selected a range.

0
SortScanAvgdouble

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

0
SortRowsAvgdouble

The average number of sorted rows.

0
TmpTablesAvgdouble

The average number of temporary tables.

0
TmpDiskTablesAvgdouble

The average number of on-disk temporary tables.

0
FirstTimelong

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
LastTimelong

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
LockLatencyAvgdouble

The average lock wait latency. Unit: millisecond.

0
TimerWaitAvgdouble

The reserved parameter.

None
SortRangeAvgdouble

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

0
CpuRatedouble

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

0
Dbstring

The name of the database.

testDB
Tablesarray

The names of tables in the database.

string

The names of tables in the database.

test_table
PageNolong

The page number.

1
PageSizelong

The number of entries per page.

10
Extraany

The reserved parameter.

None
Codelong

The HTTP status code returned.

200
Successboolean

Indicates whether the request was successful. Valid values:

  • true
  • false
true

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError message
400InvalidParamsThe request parameters are invalid.
403NoPermissionYou are not authorized to do this action.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history