All Products
Search
Document Center

Database Autonomy Service:GetPfsSqlSummaries

Last Updated:Jun 10, 2026

Memanggil API GetPfsSqlSummaries untuk mengkueri semua data permintaan menggunakan dimensi ID SQL di Wawasan Kinerja (Versi Baru) untuk instans database.

Deskripsi operasi

Prerequisites for using this API:

  • Use the latest version of the Alibaba Cloud or DAS SDK.

  • When calling the DAS service using the SDK, specify the region as cn-shanghai.

  • The target database instance is RDS MySQL or PolarDB MySQL.

  • The target database instance has Performance Insight (New Version) enabled. For more information, see Performance Insight (New Version).

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

hdm:GetPfsSqlSummaries

get

*全部资源

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

InstanceId

string

No

ID instans database.

rm-uf61swc4cru0b****

NodeId

string

No

ID node.

Catatan

Berikan ID node untuk instans database RDS MySQL Edisi Kluster atau PolarDB Basis Data Relasional Cloud-Native for MySQL.

r-****-db-0

SqlId

string

No

ID SQL.

Catatan

Jika Anda menentukan ID SQL, sistem akan mengembalikan statistik hanya untuk ID SQL tersebut. Jika Anda mengosongkan parameter ini, sistem akan mengembalikan statistik untuk seluruh instans database.

651b56fe9418d48edb8fdf0980ec****

Keywords

string

No

Kata kunci dalam teks SQL. Pisahkan beberapa kata kunci dengan spasi.

select update

StartTime

integer

No

Waktu mulai kueri, dalam format stempel waktu UNIX, dalam milidetik.

1675833788056

EndTime

integer

No

Waktu akhir kueri, dalam format stempel waktu UNIX, dalam milidetik.

Catatan

Waktu akhir harus lebih lambat daripada waktu mulai. Anda dapat mengkueri data untuk periode tujuh hari apa pun dalam 30 hari terakhir.

1679297005999

OrderBy

string

No

Bidang untuk pengurutan. Nilai default adalah count.

  • count: Jumlah eksekusi.

  • avgLatency: Waktu eksekusi rata-rata.

  • rowsExamined: Jumlah total baris yang dipindai.

  • rowsExaminedAvg: Jumlah baris yang dipindai rata-rata.

  • rowsSentAvg: Jumlah baris yang dikembalikan rata-rata.

count

Asc

boolean

No

Pengurutan secara menaik. Nilai default adalah false.

  • true: Ya.

  • false: Tidak.

false

PageNo

integer

No

Nomor halaman untuk kueri berhalaman. Mulai dari 1. Nilai default adalah 1.

1

PageSize

integer

No

Jumlah maksimum rekaman per halaman untuk kueri berhalaman. Nilai default adalah 10. Maksimum adalah 100.

10

Elemen respons

Element

Type

Description

Example

object

List of SQL summaries.

Message

string

Response message.

Catatan

If the request succeeds, this parameter returns Successful. If it fails, it returns error details such as an error code.

Successful

RequestId

string

Request ID.

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

Data

object

Response data.

Total

integer

Total number of records.

264

List

array<object>

Detailed information list.

object

List of returned items.

UserId

string

The user ID.

196278346919****

Psql

string

The SQL template.

select ?

InstanceId

string

The instance ID.

rm-2ze8g2am97624****

NodeId

string

The node ID.

Catatan

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.

Catatan

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

Page number.

1

PageSize

integer

Maximum number of records per page.

10

Extra

any

Reserved parameter.

None

Code

integer

Response status code.

200

Success

boolean

Indicates whether the request succeeded:

  • true: Succeeded.

  • false: Failed.

true

Contoh

Respons sukses

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
}

Kode kesalahan

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.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.