查询topSql
更新时间:2025-05-29
查询topSql
接口描述
本接口用于查询topSql。
请求结构
Plain Text
1GET /v{version}/ddc/ob/instance/{instanceId}/tenant/{tenantId}/sql/topSql 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参数 | 所有字段通过 @ 来引用。可选字段请参考查询ObTopSQLModel。 示例:filterCondition=@avgCpuTime>20and@executions>100 filterCondition=@userName='test11'and@dbName='test11' |
响应头域
除公共头域外,无其它特殊头域。
响应参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| dataList | List<ObTopSQLModel> | 列表数据。 |
请求示例
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&filterCondition=@avgCpuTime>20and@executions>100
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": 4.5895924E7,
10 "remotePlans": 0.0,
11 "missPlans": 4.5895924E7,
12 "maxElapsedTime": 1.69,
13 "execPs": 16450.15,
14 "maxCpuTime": 0.41,
15 "cpuPercentage": 2.48,
16 "userName": "test",
17 "dbName": "default_database",
18 "retCode4012Count": 0,
19 "retCode4013Count": 0,
20 "retCode5001Count": 0,
21 "retCode5024Count": 0,
22 "retCode5167Count": 0,
23 "retCode5217Count": 0,
24 "retCode6002Count": 0,
25 "failPercentage": 0.0,
26 "sumWaitTime": 0.0,
27 "avgWaitCount": 0.0,
28 "avgRpcCount": 0.0,
29 "localPlanPercentage": 0.0,
30 "remotePlanPercentage": 0.0,
31 "distPlanPercentage": 0.0,
32 "sumElapsedTime": 1529760.66,
33 "avgNetTime": 0.0,
34 "avgExecutorRpcCount": 0.0,
35 "missPlanPercentage": 100.0,
36 "tableScanPercentage": 0.0,
37 "strongConsistencyPercentage": 0.0,
38 "weakConsistencyPercentage": 0.0,
39 "maxAffectedRows": 0.0,
40 "maxReturnRows": 0.0,
41 "avgExpectedWorkerCount": 0.0,
42 "avgUsedWorkerCount": 0.0,
43 "sumLogicalReads": 0.0,
44 "serverIp": "i-us7nak6b",
45 "sqlTextShort": "BEGIN",
46 "sqlType": "OTHER",
47 "sqlId": "19AAD9F2FE3CE0023298AB83F7E75775",
48 "inner": false,
49 "waitEvent": "none",
50 "avgAffectedRows": 0.0,
51 "avgReturnRows": 0.0,
52 "avgPartitionCount": 0.0,
53 "failCount": 0.0,
54 "avgWaitTime": 0.0,
55 "avgElapsedTime": 0.03,
56 "avgCpuTime": 0.02,
57 "avgNetWaitTime": 0.0,
58 "avgQueueTime": 0.01,
59 "avgDecodeTime": 0.0,
60 "avgGetPlanTime": 0.01,
61 "avgExecuteTime": 0.01,
62 "avgApplicationWaitTime": 0.0,
63 "avgConcurrencyWaitTime": 0.0,
64 "avgUserIoWaitTime": 0.0,
65 "avgScheduleTime": 0.0,
66 "avgRowCacheHit": 0.0,
67 "avgBloomFilterCacheHit": 0.0,
68 "avgBlockCacheHit": 0.0,
69 "avgBlockIndexCacheHit": 0.0,
70 "avgDiskReads": 0.0,
71 "retryCount": 0.0,
72 "avgMemstoreReadRows": 0.0,
73 "avgSsstoreReadRows": 0.0,
74 "avgLogicalReads": 0.0
75 }
76 ]
77}
评价此篇文章
