查询诊断系统采集到的 SQL 执行性能数据列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:- 对于必选的资源类型,用前面加 * 表示。
- 对于不支持资源级授权的操作,用全部资源表示。
 
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
| 操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 | 
|---|---|---|---|---|
| oceanbase:DescribeOasTopSQLList | get | *全部资源 * | 
 | 无 | 
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 | 
|---|---|---|---|---|
| InstanceId | string | 是 | OceanBase 集群 ID。 | ob317v4uif**** | 
| TenantId | string | 是 | 租户 ID。 | t4louaeei**** | 
| StartTime | string | 是 | 查询 TOPSQL 参数的起始时间。 该时间只支持 UTC 时间,格式为:YYYY-MM-DDThh:mm:ssZ。 | 2023-04-12T04:38:38Z | 
| EndTime | string | 是 | 查询 TOPSQL 参数的结束时间。 该时间只支持 UTC 时间,格式为:YYYY-MM-DDThh:mm:ssZ。 | 2023-04-12T05:38:38Z | 
| DbName | string | 否 | 数据库名称。 | test_db | 
| SearchKeyWord | string | 否 | 关键字查询。 | update | 
| SearchParam | string | 否 | 参数查询。 | cputime | 
| SearchRule | string | 否 | 查询规则。 | > | 
| SearchValue | string | 否 | 查询值。 | 0.01 | 
| SqlId | string | 否 | SQL ID。 | 8D6E84****0B8FB1823D199E2CA1**** | 
| NodeIp | string | 否 | 节点 IP。 | i-bp18l4****str4uk03 | 
| FilterCondition | string | 否 | 所有字段通过 @ 来引用。可选字段请参考 查询 SQL 的性能统计 接口返回的所有列。 | @avgCpuTime > 20 and @executions > 100 | 
| AcceptLanguage | string | 否 | 返回信息的语言类型: 
 | zh-CN | 
| SqlTextLength | long | 否 | 返回 SQL 文本的最大长度。 | 65535 | 
| DynamicSql | boolean | 否 | 是否动态 SQL。 说明 
 表示传入的 SQL ID 是否为动态 SQL 的 ID。 | false | 
| MergeDynamicSql | boolean | 否 | 返回结果时,是否合并动态 SQL。 说明 
 表示输出结果时,是否聚合 in 查询的 SQL 的结果。 | true | 
| CustomColumns | string | 否 | 自定义字段规则。所有字段通过 @ 来引用,运算符支持  | @failCount/@executions | 
返回参数
示例
正常返回示例
JSON格式
{
  "RequestId": "EE205C00-30E4-****-****-87E3A8A2AA0C",
  "Data": [
    {
      "Executions": 100,
      "RpcCount": 100,
      "RemotePlans": 100,
      "MissPlans": 100,
      "MaxElapsedTime": 10000,
      "TotalWaitTime": 100000,
      "ExecPs": 0.31,
      "MaxCpuTime": 13641.9,
      "CpuPercentage": 100,
      "ClientIp": "i-bp1db****38uemejio",
      "UserName": "test_user",
      "DbName": "test_db",
      "RetCode4012Count": 0,
      "RetCode4013Count": 0,
      "RetCode5001Count": 0,
      "RetCode5024Count": 0,
      "RetCode5167Count": 0,
      "RetCode5217Count": 0,
      "RetCode6002Count": 0,
      "FailPercentage": 0,
      "SumWaitTime": 9421.73,
      "AvgWaitCount": 0,
      "AvgRpcCount": 8,
      "LocalPlanPercentage": 0,
      "RemotePlanPercentage": 0,
      "DistPlanPercentage": 100,
      "SumElapsedTime": 11452126.36,
      "AvgNetTime": 0,
      "AvgExecutorRpcCount": 0,
      "MissPlanPercentage": 0,
      "TableScanPercentage": 0,
      "StrongConsistencyPercentage": 100,
      "WeakConsistencyPercentage": 0,
      "MaxAffectedRows": 10000,
      "MaxReturnRows": 0,
      "MaxWaitTime": 3.4,
      "MaxApplicationWaitTime": 0,
      "MaxConcurrencyWaitTime": 0,
      "MaxUserIoWaitTime": 0,
      "MaxDiskReads": 0,
      "AvgExpectedWorkerCount": 3,
      "AvgUsedWorkerCount": 3,
      "SumLogicalReads": 0,
      "Server": "i-bp1db1****8uemejio",
      "ServerIp": "i-bp1db1****8uemejio",
      "ServerPort": 389,
      "SqlTextShort": "delete /*+ XXX PARALLEL(4) */ fro",
      "SqlType": "select ",
      "SqlId": "8D6E84****0B8FB1823D199E2CA1****",
      "Inner": false,
      "WaitEvent": "none",
      "AvgAffectedRows": 9978.75,
      "AvgReturnRows": 0,
      "AvgPartitionCount": 1,
      "FailCount": 0,
      "AvgWaitTime": 1442.49,
      "AvgElapsedTime": 903.29,
      "AvgCpuTime": 1875.34,
      "AvgNetWaitTime": 0,
      "AvgQueueTime": 0.01,
      "AvgDecodeTime": 0,
      "AvgGetPlanTime": 0,
      "AvgExecuteTime": 1895.7,
      "AvgApplicationWaitTime": 0,
      "AvgConcurrencyWaitTime": 0,
      "AvgUserIoWaitTime": 0,
      "AvgScheduleTime": 0,
      "AvgRowCacheHit": 0,
      "AvgBloomFilterCacheHit": 0,
      "AvgBlockCacheHit": 0,
      "AvgBlockIndexCacheHit": 0,
      "AvgDiskReads": 0,
      "RetryCount": 0,
      "AvgMemstoreReadRows": 0,
      "AvgSsstoreReadRows": 0,
      "AvgLogicalReads": 0,
      "DynamicSql": false,
      "SqlList": [
        {
          "Executions": 100,
          "RpcCount": 100,
          "RemotePlans": 100,
          "MissPlans": 100,
          "MaxElapsedTime": 10000,
          "TotalWaitTime": 100000,
          "ExecPs": 0.31,
          "MaxCpuTime": 13641.9,
          "CpuPercentage": 100,
          "ClientIp": "127.*.*.*",
          "UserName": "test_user",
          "DbName": "test",
          "RetCode4012Count": 0,
          "RetCode4013Count": 0,
          "RetCode5001Count": 0,
          "RetCode5024Count": 0,
          "RetCode5167Count": 0,
          "RetCode5217Count": 0,
          "RetCode6002Count": 0,
          "FailPercentage": 0,
          "SumWaitTime": 9421.73,
          "AvgWaitCount": 0,
          "AvgRpcCount": 8,
          "LocalPlanPercentage": 0,
          "RemotePlanPercentage": 0,
          "DistPlanPercentage": 100,
          "SumElapsedTime": 11452126.36,
          "AvgNetTime": 0,
          "AvgExecutorRpcCount": 0,
          "MissPlanPercentage": 0,
          "TableScanPercentage": 0,
          "StrongConsistencyPercentage": 100,
          "WeakConsistencyPercentage": 0,
          "MaxAffectedRows": 10000,
          "MaxReturnRows": 0,
          "MaxWaitTime": 3.4,
          "MaxApplicationWaitTime": 0,
          "MaxConcurrencyWaitTime": 0,
          "MaxUserIoWaitTime": 0,
          "MaxDiskReads": 0,
          "AvgExpectedWorkerCount": 3,
          "AvgUsedWorkerCount": 3,
          "SumLogicalReads": 0,
          "Server": "i-bp1db1****8uemejio",
          "ServerIp": "i-bp1db1****8uemejio",
          "ServerPort": 389,
          "SqlTextShort": "delete /*+ XXX PARALLEL(4) */ fro",
          "SqlType": "select",
          "SqlId": "8D6E84****0B8FB1823D199E2CA1****",
          "Inner": false,
          "WaitEvent": "none",
          "AvgAffectedRows": 9978.75,
          "AvgReturnRows": 0,
          "AvgPartitionCount": 1,
          "FailCount": 0,
          "AvgWaitTime": 1442.49,
          "AvgElapsedTime": 903.29,
          "AvgCpuTime": 1875.34,
          "AvgNetWaitTime": 0,
          "AvgQueueTime": 0.01,
          "AvgDecodeTime": 0,
          "AvgGetPlanTime": 0,
          "AvgExecuteTime": 1895.7,
          "AvgApplicationWaitTime": 0,
          "AvgConcurrencyWaitTime": 0,
          "AvgUserIoWaitTime": 0,
          "AvgScheduleTime": 0,
          "AvgRowCacheHit": 0,
          "AvgBloomFilterCacheHit": 0,
          "AvgBlockCacheHit": 0,
          "AvgBlockIndexCacheHit": 0,
          "AvgDiskReads": 0,
          "RetryCount": 2,
          "AvgMemstoreReadRows": 0,
          "AvgSsstoreReadRows": 0,
          "AvgLogicalReads": 0,
          "AvgDbTime": 100,
          "SumDbTime": 100,
          "FormatSqlId": ""
        }
      ],
      "LastFailCode": -4012,
      "AvgDbTime": 100,
      "SumDbTime": 100,
      "CustomColumns": {
        "Expression": "@failCount/@executions",
        "Value": 0
      },
      "ObDbId": 0,
      "FormatSqlId": ""
    }
  ]
}错误码
访问错误中心查看更多错误码。
变更历史
| 变更时间 | 变更内容概要 | 操作 | 
|---|---|---|
| 2025-07-08 | OpenAPI 返回结构发生变更 | 查看变更详情 | 
| 2025-04-22 | OpenAPI 入参发生变更、OpenAPI 返回结构发生变更 | 查看变更详情 | 
| 2024-04-15 | OpenAPI 返回结构发生变更 | 查看变更详情 | 
| 2023-08-21 | OpenAPI 入参发生变更、OpenAPI 返回结构发生变更 | 查看变更详情 | 
