查询SlowSql
更新时间:2025-05-29
查询SlowSql
接口描述
本接口用于查询slowSql。
请求结构
Plain Text
1GET /v{version}/ddc/ob/instance/{instanceId}/tenant/{tenantId}/sql/slowSql HTTP/1.1
2Host: ddc.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
|---|---|---|---|---|
| version | String | 是 | URL参数 | API版本号。 |
| instanceId | String | 是 | URL参数 | 集群ID |
| tenantId | String | 是 | URL参数 | 租户ID |
| startTime | String | 是 | Query参数 | 开始时间。格式2023-04-12T04:38:38Z |
| endTime | String | 是 | Query参数 | 结束时间。格式2023-04-12T04:38:38Z。 |
| dbName | String | 否 | Query参数 | 数据库名称 |
| searchKeyWord | String | 否 | Query参数 | 关键字查询 |
| nodeIp | String | 否 | Query参数 | 节点 IP |
| sqlTextLength | Long | 否 | Query参数 | 返回 SQL 文本的最大长度。 |
| filterCondition | String | 否 | Query参数 | 所有字段通过 @ 来引用。可选字段请参考查询ObSlowSqlModel。 示例:filterCondition=@avgCpuTime>20and@executions>100 filterCondition=@userName='test11'and@dbName='test11' |
响应头域
除公共头域外,无其它特殊头域。
响应参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| dataList | List<ObSlowSqlModel> | 列表数据。 |
请求示例
Plain Text
1GET http://ddc.bj.baidubce.com/v1/ddc/ob/instance/ob6qic1xdgyulc/tenant/t6qp3okdot8g0/sql/topSql?startTime=2025-05-16T03:46:38Z&endTime=2025-05-16T04:46:38Z
2Host: ddc.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
响应示例
Plain Text
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3Date: Wed, 08 Jul 2015 03:28:11 GMT
4x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
5Server: BWS
6{
7 "dataList": [
8 {
9 "executions": 1,
10 "rpcCount": 0,
11 "remotePlans": 0,
12 "missPlans": 0,
13 "maxElapsedTime": 13643.3,
14 "totalWaitTime": 10.966,
15 "execPs": 0.31,
16 "maxCpuTime": 13641.9,
17 "cpuPercentage": 100,
18 "clientIp": "i-bp1db****38uemejio",
19 "userName": "test_user",
20 "dbName": "test_db",
21 "retCode4012Count": 0,
22 "retCode4013Count": 0,
23 "retCode5001Count": 0,
24 "retCode5024Count": 0,
25 "retCode5167Count": 0,
26 "retCode5217Count": 0,
27 "retCode6002Count": 0,
28 "failPercentage": 0,
29 "sumWaitTime": 9421.73,
30 "avgWaitCount": 0,
31 "avgRpcCount": 8,
32 "localPlanPercentage": 0,
33 "remotePlanPercentage": 0,
34 "distPlanPercentage": 100,
35 "sumElapsedTime": 11452126.36,
36 "avgNetTime": 0,
37 "avgExecutorRpcCount": 0,
38 "missPlanPercentage": 0,
39 "tableScanPercentage": 0,
40 "strongConsistencyPercentage": 100,
41 "weakConsistencyPercentage": 0,
42 "maxAffectedRows": 10000,
43 "maxReturnRows": 0,
44 "maxWaitTime": 3.4,
45 "maxApplicationWaitTime": 0,
46 "maxConcurrencyWaitTime": 0,
47 "maxUserIoWaitTime": 0,
48 "maxDiskReads": 0,
49 "avgExpectedWorkerCount": 3,
50 "avgUsedWorkerCount": 3,
51 "sumLogicalReads": 0,
52 "server": "i-bp1db1****8uemejio",
53 "serverIp": "i-bp1db1****8uemejio",
54 "serverPort": 389,
55 "sqlTextShort": "delete /*+ XXX PARALLEL(4) */ fro",
56 "sqlType": "select ",
57 "sqlId": "8D6E84****0B8FB1823D199E2CA1****",
58 "inner": false,
59 "waitEvent": "none",
60 "avgAffectedRows": 9978.75,
61 "avgReturnRows": 0,
62 "avgPartitionCount": 1,
63 "failCount": 0,
64 "avgWaitTime": 1442.49,
65 "avgElapsedTime": 903.29,
66 "avgCpuTime": 1875.34,
67 "avgNetWaitTime": 0,
68 "avgQueueTime": 0.01,
69 "avgDecodeTime": 0,
70 "avgGetPlanTime": 0,
71 "avgExecuteTime": 1895.7,
72 "avgApplicationWaitTime": 0,
73 "avgConcurrencyWaitTime": 0,
74 "avgUserIoWaitTime": 0,
75 "avgScheduleTime": 0,
76 "avgRowCacheHit": 0,
77 "avgBloomFilterCacheHit": 0,
78 "avgBlockCacheHit": 0,
79 "avgBlockIndexCacheHit": 0,
80 "avgDiskReads": 0,
81 "retryCount": 0,
82 "avgMemstoreReadRows": 0,
83 "avgSsstoreReadRows": 0,
84 "avgLogicalReads": 0
85 }
86 ]
87}
评价此篇文章
