搜索本产品文档关键词
根据SQLID获取慢SQL
所有文档
menu

云数据库 RDS

根据SQLID获取慢SQL

接口说明

根据SQL ID获取慢SQL

请求结构

Plain Text
1GET /v{version}/instance/{instanceId}/smartdba/{sqlId} HTTP/1.1
2HOST: rds.bj.baidubce.com
3Content-Type: application/json
4Authorization: authorization string

请求头域

除公共头域外,无其它特殊头域。

请求参数

参数名称
类型
是否必选
参数位置
描述
version String URL参数 API 版本号
instanceId String URL参数 实例ID
sqlId String URL参数 指定sqlId,示例:db71e5f6-9e19-4e7b-af25-44426f24927a

返回头域

除公共头域,无其它特殊头域。

返回参数

参数名称
类型
描述
affectedRows Long 影响行数
clientHost String 源客户端主机名
clientIP String 源客户端IP
cluster String 分片ID
connectionId Long 连接ID
currentDB String 数据库名称
digest String SQL签名
duration Double 慢SQL耗时
examinedRows Long 扫描行数
lockTime Double 锁时间
node String 节点ID
numRows Long 返回行数
sql String SQL语句
sqlId String SQL标识ID
start String 执行时间
user String 用户

请求示例

Plain Text
1GET /v1/instance/rds-xXE6pdR1/smartdba/23d44c3f-eb5a-472c-8353-1e6eef6c66dc  HTTP/1.1
2HOST: rds.bj.baidubce.com
3Content-Type: application/json
4Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2017-11-21T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de

返回示例

Plain Text
1{ 
2    "affectedRows": 0,
3    "clientHost":"",
4    "clientIP": "100.79.8.106",
5    "cluster":"",
6    "connectionId": 5024564,
7    "currentDB":"",
8    "digest": "16284340be41d86745028edae79528eb6b91364477555bef4bd842ba35ebd2ea",
9    "duration": 3.600539,
10    "examinedRows": 3,
11    "lockTime": 1.01E-4,
12    "node": "e217bb1c-1388-4d47-b5c9-726148c89dec",
13    "numRows": 3,
14    "sql": "select sleep(1.2),tb1.* from tb1",
15    "sqlId": "23d44c3f-eb5a-472c-8353-1e6eef6c66dc",
16    "start": "2023-05-05T10:43:29Z",
17    "user": "test1"
18}
上一篇
获取慢SQL诊断列表
下一篇
获取慢SQL说明