Collects the full request statistics in the SQL Explorer results of a database instance by access source.
The SQL Explorer feature allows you to check the health status of SQL statements and troubleshoot performance issues. For more information, see SQL Explorer.
- For information about database instances that support SQL Explorer, see Usage notes on DAS Professional Edition.
- If you use an SDK to call Database Autonomy Service (DAS), you must set the region to cn-shanghai.
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| Action | String | Yes | GetFullRequestOriginStatByInstanceId | The operation that you want to perform. Set the value to GetFullRequestOriginStatByInstanceId. |
| UserId | String | No | 196278346919**** | The ID of the Alibaba Cloud account that is used to create the database instance. Note This parameter is optional. The system can automatically obtain the account ID based on the value of the InstanceId parameter when the GetFullRequestOriginStatByInstanceId operation is called. |
| InstanceId | String | Yes | rm-2ze8g2am97624**** | The ID of the database instance. |
| NodeId | String | No | pi-bp12v7243x012**** | The ID of the node. Note For a PolarDB for MySQL instance, you must provide the ID of the node. |
| Start | Long | Yes | 1644716649000 | The beginning of the time range to query. Specify the time in the UNIX timestamp format. Unit: milliseconds. Note The start time can be up to 90 days earlier than the current time. |
| End | Long | Yes | 1644803409000 | The end of the time range to query. Specify the time in the UNIX timestamp format. Unit: milliseconds. Note The end time must be later than the start time. The interval cannot exceed one day. |
| OrderBy | String | No | count | The field by which to sort the results. Default value: count. Valid values:
|
| Asc | Boolean | No | Disabled | Specifies whether to sort the results in ascending order. By default, the results are not sorted in any order. |
| PageNo | Integer | Yes | 1 | The number of the page to return. Pages start from page 1. Default value: 1. |
| PageSize | Integer | Yes | 20 | The maximum number of entries to return on each page. Default value: 20. |
| SqlType | String | No | SELECT | The type of the SQL statement. Valid values: SELECT, INSERT, UPDATE, DELETE, LOGIN, LOGOUT, MERGE, ALTER, CREATEINDEX, DROPINDEX, CREATE, DROP, SET, DESC, REPLACE, CALL, BEGIN, DESCRIBE, ROLLBACK, FLUSH, USE, SHOW, START, COMMIT, and RENAME. Note If the database instance is an ApsaraDB RDS for MySQL instance, a PolarDB for MySQL instance, or a PolarDB-X 2.0 instance, statistics can be collected based on the SQL statement type. |
| Role | String | No | polarx_cn | The role of the PolarDB-X 2.0 node. Valid values:
|
Response parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
| Message | String | Successful | The message that is returned for the request. Note If the request is successful, Successful is returned. If the request fails, an error message that contains information such as an error code is returned. |
| RequestId | String | 7172BECE-588A-5961-8126-C216E16B**** | The ID of the request. |
| Data | Object | The returned data. | |
| List | Array of List | The full request data entries. | |
| Key | String | 172.26.6**** | The IP address of the client that executes the SQL statement. |
| AvgFetchRows | Long | 0 | The average number of rows that are fetched by compute nodes from data nodes on the PolarDB-X 2.0 instance. |
| AvgLockWaitTime | double | 0.00009589874265269765 | The average lock wait duration. Unit: seconds. |
| AvgLogicalRead | double | 654.4470327860251 | The average number of logical reads. |
| AvgPhysicalAsyncRead | Long | 0 | The average number of physical asynchronous reads. |
| AvgPhysicalSyncRead | double | 0 | The average number of physical synchronous reads. |
| AvgRows | Long | 0 | The average number of rows. |
| AvgExaminedRows | double | 10000 | The average number of scanned rows. Note This parameter is returned only for ApsaraDB RDS for MySQL, ApsaraDB RDS for PostgreSQL, and PolarDB for MySQL databases. |
| AvgReturnedRows | double | 10000 | The average number of returned rows. |
| AvgUpdatedRows | double | 10000 | The average number of updated rows. Note This parameter is returned only for ApsaraDB RDS for MySQL and PolarDB-X 2.0 databases. |
| AvgRt | double | 2.499 | The average execution duration. |
| AvgSqlCount | Long | 10000 | The average number of SQL statements. |
| Count | Long | 100000 | The total number of executions. |
| CountRate | double | 0.0586 | The percentage of the total number of executions. |
| Database | String | dbtest01 | The name of the database. |
| ErrorCount | Long | 1 | The number of failed executions. |
| FetchRows | Long | 200 | The number of rows that are fetched by compute nodes from data nodes on the PolarDB-X 2.0 instance. |
| Ip | String | rm-uf6dyi58dm6****.mysql.rds.aliy****.com | The network address of the database instance. |
| LockWaitTime | double | 1089.4177720290281 | The lock wait duration. Unit: seconds. |
| LogicalRead | Long | 7.434573266E9 | The number of logical reads. |
| OriginHost | String | 172.26.6**** | The IP address of the client that executes the SQL statement. |
| PhysicalAsyncRead | Long | 0 | The number of physical asynchronous reads. |
| PhysicalSyncRead | Long | 0 | The number of physical synchronous reads. |
| Port | Long | 3306 | The port number. |
| Rows | Long | 0 | The total number of rows updated or returned by the compute nodes of the PolarDB-X 2.0 instance. |
| ExaminedRows | Long | 10000 | The total number of scanned rows. Note This parameter is returned only for ApsaraDB RDS for MySQL, ApsaraDB RDS for PostgreSQL, and PolarDB for MySQL databases. |
| RtGreaterThanOneSecondCount | Long | 2 | The number of SQL statements that take longer than 1 second to execute. |
| RtRate | double | 0.1384 | The execution duration percentage. |
| SqlCount | Long | 200 | The number of SQL statements. |
| SumUpdatedRows | Long | 200 | The total number of updated rows. |
| Version | Long | 1 | The version. |
| VpcId | String | vpc-2zentqj1sk4qmolci**** | The ID of the virtual private cloud (VPC). |
| Total | Long | 1 | The total number of returned entries. |
| Code | Long | 200 | The returned HTTP status code. |
| Success | Boolean | true | Indicates whether the request is successful. Valid values:
|
Examples
Sample requests
http(s)://das.cn-shanghai.aliyuncs.com/?Action=GetFullRequestOriginStatByInstanceId
&UserId=196278346919****
&InstanceId=rm-2ze8g2am97624****
&Start=1644716649000
&End=1644803409000
&OrderBy=count
&PageNo=1
&PageSize=20
&SqlType=SELECT
&<Common request parameters>Sample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<GetFullRequestOriginStatByInstanceIdResponse>
<Message>Successful</Message>
<RequestId>7172BECE-588A-5961-8126-C216E16B****</RequestId>
<Data>
<List>
<Key>172.26.6****</Key>
<AvgFetchRows>0</AvgFetchRows>
<AvgLockWaitTime>0.00009589874265269765</AvgLockWaitTime>
<AvgLogicalRead>654.4470327860251</AvgLogicalRead>
<AvgPhysicalAsyncRead>0</AvgPhysicalAsyncRead>
<AvgPhysicalSyncRead>0</AvgPhysicalSyncRead>
<AvgRows>0</AvgRows>
<AvgExaminedRows>10000</AvgExaminedRows>
<AvgReturnedRows>10000</AvgReturnedRows>
<AvgUpdatedRows>10000</AvgUpdatedRows>
<AvgRt>2.499</AvgRt>
<AvgSqlCount>10000</AvgSqlCount>
<Count>100000</Count>
<CountRate>0.0586</CountRate>
<Database>dbtest01</Database>
<ErrorCount>1</ErrorCount>
<FetchRows>200</FetchRows>
<Ip>rm-uf6dyi58dm6****.mysql.rds.aliy****.com</Ip>
<LockWaitTime>1089.4177720290281</LockWaitTime>
<OriginHost>172.26.6****</OriginHost>
<PhysicalAsyncRead>0</PhysicalAsyncRead>
<PhysicalSyncRead>0</PhysicalSyncRead>
<Port>3306</Port>
<Rows>0</Rows>
<ExaminedRows>10000</ExaminedRows>
<RtGreaterThanOneSecondCount>2</RtGreaterThanOneSecondCount>
<RtRate>0.1384</RtRate>
<SqlCount>200</SqlCount>
<SumUpdatedRows>200</SumUpdatedRows>
<Version>1</Version>
<VpcId>vpc-2zentqj1sk4qmolci****</VpcId>
</List>
<Total>1</Total>
</Data>
<Code>200</Code>
<Success>true</Success>
</GetFullRequestOriginStatByInstanceIdResponse>JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"Message" : "Successful",
"RequestId" : "7172BECE-588A-5961-8126-C216E16B****",
"Data" : {
"List" : [ {
"Key" : "172.26.6****",
"AvgFetchRows" : 0,
"AvgLockWaitTime" : 9.589874265269765E-5,
"AvgLogicalRead" : 654.4470327860251,
"AvgPhysicalAsyncRead" : 0,
"AvgPhysicalSyncRead" : 0,
"AvgRows" : 0,
"AvgExaminedRows" : 10000,
"AvgReturnedRows" : 10000,
"AvgUpdatedRows" : 10000,
"AvgRt" : 2.499,
"AvgSqlCount" : 10000,
"Count" : 100000,
"CountRate" : 0.0586,
"Database" : "dbtest01",
"ErrorCount" : 1,
"FetchRows" : 200,
"Ip" : "rm-uf6dyi58dm6****.mysql.rds.aliy****.com",
"LockWaitTime" : 1089.4177720290281,
"OriginHost" : "172.26.6****",
"PhysicalAsyncRead" : 0,
"PhysicalSyncRead" : 0,
"Port" : 3306,
"Rows" : 0,
"ExaminedRows" : 10000,
"RtGreaterThanOneSecondCount" : 2,
"RtRate" : 0.1384,
"SqlCount" : 200,
"SumUpdatedRows" : 200,
"Version" : 1,
"VpcId" : "vpc-2zentqj1sk4qmolci****"
} ],
"Total" : 1
},
"Code" : 200,
"Success" : true
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | InvalidParams | The request parameters are invalid. | The error message returned because the specified request parameters are invalid. |
For a list of error codes, visit the API Error Center.