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

ParameterTypeRequiredExampleDescription
ActionStringYesGetFullRequestOriginStatByInstanceId

The operation that you want to perform. Set the value to GetFullRequestOriginStatByInstanceId.

UserIdStringNo196278346919****

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.
InstanceIdStringYesrm-2ze8g2am97624****

The ID of the database instance.

NodeIdStringNopi-bp12v7243x012****

The ID of the node.

Note For a PolarDB for MySQL instance, you must provide the ID of the node.
StartLongYes1644716649000

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

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

The field by which to sort the results. Default value: count. Valid values:

  • count: the number of executions.
  • avgRt: the average execution time.
  • 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.
AscBooleanNoDisabled

Specifies whether to sort the results in ascending order. By default, the results are not sorted in any order.

PageNoIntegerYes1

The number of the page to return. Pages start from page 1. Default value: 1.

PageSizeIntegerYes20

The maximum number of entries to return on each page. Default value: 20.

SqlTypeStringNoSELECT

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

The role of the PolarDB-X 2.0 node. Valid values:

  • polarx_cn: compute node
  • polarx_en: data node

Response parameters

ParameterTypeExampleDescription
MessageStringSuccessful

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.
RequestIdString7172BECE-588A-5961-8126-C216E16B****

The ID of the request.

DataObject

The returned data.

ListArray of List

The full request data entries.

KeyString172.26.6****

The IP address of the client that executes the SQL statement.

AvgFetchRowsLong0

The average number of rows that are fetched by compute nodes from data nodes on the PolarDB-X 2.0 instance.

AvgLockWaitTimedouble0.00009589874265269765

The average lock wait duration. Unit: seconds.

AvgLogicalReaddouble654.4470327860251

The average number of logical reads.

AvgPhysicalAsyncReadLong0

The average number of physical asynchronous reads.

AvgPhysicalSyncReaddouble0

The average number of physical synchronous reads.

AvgRowsLong0

The average number of rows.

AvgExaminedRowsdouble10000

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

The average number of returned rows.

AvgUpdatedRowsdouble10000

The average number of updated rows.

Note This parameter is returned only for ApsaraDB RDS for MySQL and PolarDB-X 2.0 databases.
AvgRtdouble2.499

The average execution duration.

AvgSqlCountLong10000

The average number of SQL statements.

CountLong100000

The total number of executions.

CountRatedouble0.0586

The percentage of the total number of executions.

DatabaseStringdbtest01

The name of the database.

ErrorCountLong1

The number of failed executions.

FetchRowsLong200

The number of rows that are fetched by compute nodes from data nodes on the PolarDB-X 2.0 instance.

IpStringrm-uf6dyi58dm6****.mysql.rds.aliy****.com

The network address of the database instance.

LockWaitTimedouble1089.4177720290281

The lock wait duration. Unit: seconds.

LogicalReadLong7.434573266E9

The number of logical reads.

OriginHostString172.26.6****

The IP address of the client that executes the SQL statement.

PhysicalAsyncReadLong0

The number of physical asynchronous reads.

PhysicalSyncReadLong0

The number of physical synchronous reads.

PortLong3306

The port number.

RowsLong0

The total number of rows updated or returned by the compute nodes of the PolarDB-X 2.0 instance.

ExaminedRowsLong10000

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

The number of SQL statements that take longer than 1 second to execute.

RtRatedouble0.1384

The execution duration percentage.

SqlCountLong200

The number of SQL statements.

SumUpdatedRowsLong200

The total number of updated rows.

VersionLong1

The version.

VpcIdStringvpc-2zentqj1sk4qmolci****

The ID of the virtual private cloud (VPC).

TotalLong1

The total number of returned entries.

CodeLong200

The returned HTTP status code.

SuccessBooleantrue

Indicates whether the request is successful. Valid values:

  • true
  • false

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 codeError codeError messageDescription
400InvalidParamsThe 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.