文档

DescribeTopSQLList - 查询 TopSQL 列表

更新时间:

查询诊断系统采集到的 SQL 执行性能数据列表。

接口说明

为优化用户体验,云数据库对 SQL 诊断功能进行了升级,本接口已下线并由新的接口替代,详情请参见 【通知】云数据库诊断管理 API 接口下线

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

当前API暂无授权信息透出。

请求参数

名称类型必填描述示例值
TenantIdstring

租户 ID。

t2mr3oae0****
StartTimestring

查询 TOPSQL 参数的起始时间。
该时间只支持 UTC 时间,格式为:YYYY-MM-DDThh:mm:ssZ。

2021-06-13T15:40:43Z
EndTimestring

查询 TOPSQL 参数的结束时间。
该时间只支持 UTC 时间,格式为:YYYY-MM-DDThh:mm:ssZ。

2021-09-13T15:40:43Z
DbNamestring

数据库名称。

testdb
SearchKeyWordstring

关键字查询。

update
SearchParameterstring

参数查询。

cputime
SearchRulestring

查询规则。

>
SearchValuestring

查询值。

0.01
SQLIdstring

SQLID。

8D6E84****0B8FB1823D199E2CA1****
NodeIpstring

节点 IP。

i-bp19y05uq6xpacyqnlrc
PageNumberinteger

分页查询的页码。

  • 起始值:1。
  • 默认值:1。
1
PageSizeinteger

分页查询时设置的每页行数。

  • 最大值:100。
  • 默认值:10。
10
FilterConditionobject

过滤条件。

[dbName:sys]
SortColumnstring

排序列。

cputime
SortOrderstring

排序规则。

desc

返回参数

名称类型描述示例值
object

请求的返回结果。

TotalCountlong

总数量。

9
RequestIdstring

请求 ID。

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
TopSQLListobject []

TOPSQL 列表。

Keylong

返回数据序号。

1
ExecPerSecondfloat

每秒次数。

163.0
SQLTextstring

SQL 文本。

SELECT **** FROM **** WHERE **** = ? AND **** = ? ORDER BY **** ASC
MaxCpuTimefloat

最大 CPU 时间,单位 ms。

257.967
BlockCacheHitlong

BlockCache 命中次数。

14
DecodeTimefloat

解码等待时间,单位 ms。

0.0
RemotePlanslong

远程计划数。

0
RPCCountlong

RPC 次数。

0
NetWaitTimefloat

网络等待时间,单位 ms。

0.0
DiskReadlong

物理读。

0
NodeIpstring

节点 IP。

i-bp18qljorblo8es*****
ConcurrencyWaitTimefloat

并发等待时间,单位 ms。

0.0
MemstoreReadRowCountlong

读内存行数。

527
DbNamestring

数据库名。

testdb
AppWaitTimefloat

客户端等待时间,单位 ms。

0.0
ElapsedTimefloat

平均响应时间,单位 ms。

76.382
MissPlanslong

未命中计划次数。

0
AffectedRowslong

影响行数。

0
ScheduleTimefloat

调度时间,单位 ms。

0.0
Eventstring

等待事件。

mysql response wait client
TotalWaitTimefloat

内部等待时间,单位 ms。

10.966
ReturnRowslong

返回行数。

1
ExecuteTimefloat

内部执行时间,单位 ms。

61.044
UserNamestring

用户名。

tester
Executionslong

执行次数。

89403
GetPlanTimefloat

硬解析时间,单位 ms。

0.052
CpuTimefloat

平均 CPU 时间,单位 ms。

50.13
MaxElapsedTimefloat

最大响应时间,单位 ms。

260.044
SQLTypelong

SQL 类型。

1
BlockIndexCacheHitlong

BlockIndexCache 命中次数。

4
RetryCountlong

重试次数。

0
SQLIdstring

SQLID。

8D6E84****0B8FB1823D199E2CA1****
ClientIpstring

客户端 IP。

1*2.***.1*3.***
BloomFilterCacheHitlong

BloomFilterCache 命中次数。

0
IOWaitTimefloat

IO 等待时间,单位 ms。

0.0
FailTimeslong

失败次数。

0
QueueTimefloat

队列等待时间,单位 ms。

15.275
RowCacheHitlong

RowCache 命中次数。

0
LogicalReadlong

SQL 在所选时间段内平均逻辑读次数。
包含读各个 cache 模块次数、磁盘 IO 次数,为衡量 SQL 过滤性的重要指标。

说明
“逻辑读/返回行数”比例越大,说明过滤性越差。通常是由 SQL 写入内容、表索引创建和 SQL 执行计划不标准等原因引起。
19
SsstoreReadRowCountlong

读磁盘行数。

43086

示例

正常返回示例

JSON格式

{
  "TotalCount": 9,
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "TopSQLList": [
    {
      "Key": 1,
      "ExecPerSecond": 163,
      "SQLText": "SELECT  ****   FROM ****   WHERE **** = ? AND **** = ?   ORDER BY **** ASC",
      "MaxCpuTime": 257.967,
      "BlockCacheHit": 14,
      "DecodeTime": 0,
      "RemotePlans": 0,
      "RPCCount": 0,
      "NetWaitTime": 0,
      "DiskRead": 0,
      "NodeIp": "i-bp18qljorblo8es*****",
      "ConcurrencyWaitTime": 0,
      "MemstoreReadRowCount": 527,
      "DbName": "testdb",
      "AppWaitTime": 0,
      "ElapsedTime": 76.382,
      "MissPlans": 0,
      "AffectedRows": 0,
      "ScheduleTime": 0,
      "Event": "mysql response wait client",
      "TotalWaitTime": 10.966,
      "ReturnRows": 1,
      "ExecuteTime": 61.044,
      "UserName": "tester",
      "Executions": 89403,
      "GetPlanTime": 0.052,
      "CpuTime": 50.13,
      "MaxElapsedTime": 260.044,
      "SQLType": 1,
      "BlockIndexCacheHit": 4,
      "RetryCount": 0,
      "SQLId": "8D6E84****0B8FB1823D199E2CA1****",
      "ClientIp": "1*2.***.1*3.***",
      "BloomFilterCacheHit": 0,
      "IOWaitTime": 0,
      "FailTimes": 0,
      "QueueTime": 15.275,
      "RowCacheHit": 0,
      "LogicalRead": 19,
      "SsstoreReadRowCount": 43086
    }
  ]
}

错误码

HTTP status code错误码错误信息描述
2014InternalErrorThe request processing has failed due to some unknown error.内部错误

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
暂无变更历史
  • 本页导读 (0)
文档反馈