DescribeSQLSamples - 查詢慢 SQL 執行明細的採樣資料

更新時間:
Copy as MD

查詢慢 SQL 執行明細的採樣資料。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

oceanbase:DescribeSQLSamples

get

*全部資源

*

請求參數

名稱

類型

必填

描述

樣本值

InstanceId

string

OceanBase 叢集 ID。

ob317v4uif****

TenantId

string

租戶 ID。

t4louaeei****

StartTime

string

查看慢 SQL 執行的起始時間。

該時間只支援 UTC 時間,格式為:YYYY-MM-DDThh:mm:ssZ。

2023-04-12T04:38:38Z

EndTime

string

查看慢 SQL 執行的結束時間。

該時間只支援 UTC 時間,格式為:YYYY-MM-DDThh:mm:ssZ。

2023-04-12T05:38:38Z

DbName

string

資料庫名稱。

test_db

SqlId

string

SQL ID。

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

ReturnSqlText

boolean

是否返回 SQL 文本。

true

返回參數

名稱

類型

描述

樣本值

object

請求的返回參數。

RequestId

string

請求 ID。

EE205C00-30E4-****-****-87E3A8A2AA0C

Data

array<object>

慢 SQL 執行明細的採樣資訊列表。

object

慢 SQL 執行明細的採樣資訊。

RequestId

integer

請求 ID。

EE205C00-30E4-****-****-87E3A8A2AA0C

TraceId

string

跟蹤 ID。

YB42C****-0005E303D1****-0-0

RequestTime

string

SQL 的請求時間。

2023-04-12T04:46:38Z

Server

string

SQL 執行所在的 Server。

i-bp1db1****8uemejio

ClientIp

string

用戶端 IP。

i-bp1db****38uemejio

ClientPort

integer

用戶端連接埠。

4****

DbName

string

資料庫名稱。

test_db

UserName

string

使用者名稱。

test_user

SqlType

string

SQL 類型。

select

PlanId

integer

執行計畫 ID。

590****

AffectedRows

integer

期間內平均更新行數。

10000.0

ReturnRows

integer

期間內平均返回行數。

0.0

PartitionCount

integer

期間內平均訪問分區數。

1.0

RetCode

integer

結果碼。

0

WaitEvent

string

期間內的最長等待事件。

none

WaitTime

number

等待時間(毫秒)。

0.0

WaitCount

integer

等待次數。

0.0

RpcCount

integer

發送 RPC 次數。

8.0

PlanType

string

計劃類型。

LOCAL

Inner

boolean

是否內部 SQL。

false

ExecutorRpc

boolean

是否發起 RPC。

0.0

HitPlan

boolean

是否命中執行計畫。

true

ElapsedTime

number

回應時間(毫秒)。

2182.66

CpuTime

number

CPU 時間(毫秒)。

3377.57

NetTime

number

網路傳輸時間(毫秒)。

0.0

NetWaitTime

number

網路入隊時間(毫秒)。

0.0

QueueTime

number

排隊時間(毫秒)。

0.02

DecodeTime

number

文法解析時間(毫秒)。

0.0

GetPlanTime

number

計劃產生時間(毫秒)。

0.19

ExecuteTime

number

計劃執行時間(毫秒)。

8262.01

ApplicationWaitTime

number

Application 事件等待時間(毫秒)。

0.0

ConcurrencyWaitTime

number

Concurrency 事件等待時間(毫秒)。

0.0

UserIoWaitTime

number

UserIO 事件等待時間(毫秒)。

0.0

ScheduleTime

number

Schedule 事件等待時間(毫秒)。

0.0

RowCacheHit

number

RowCache 叫用次數。

498.0

BloomFilterCacheHit

number

BloomFilterCache 叫用次數。

0.0

BlockCacheHit

number

BlockCache 叫用次數。

99279.0

BlockIndexCacheHit

number

BlockIndexCache 叫用次數 磁碟讀次數。

142514.0

DiskReads

number

磁碟讀次數。

96972.0

RetryCount

integer

重試次數。

0

TableScan

boolean

是否全表掃描。

false

ConsistencyLevel

string

一致性層級。

3

MemstoreReadRows

integer

Memstore 讀行數。

0

ExpectedWorkerCount

integer

並行度。

0

UsedWorkerCount

integer

SQL 實際執行線程數。

0

SsstoreReadRows

integer

Ssstore 讀行數。

986190

ObServerId

integer

server ID。

2

ObUserId

integer

使用者識別碼。

100010

ObDbId

integer

資料庫 ID。

11006111****4828

Statement

string

參數化 SQL 文本。

select a from b

TransHash

string

transaction hash。

1219****927****73791

FullSqlText

string

完整的 SQL 文本。

說明

此參數暫時不可用。

select * from test where c1 > 1 and c2 > 3;

SqlText

string

SQL 陳述式。

select ** from t

ParamsValue

string

SQL 參數值。

1****

SqlId

string

SqlTextShort

string

樣本

正常返回樣本

JSON格式

{
  "RequestId": "EE205C00-30E4-****-****-87E3A8A2AA0C",
  "Data": [
    {
      "RequestId": 0,
      "TraceId": "YB42C****-0005E303D1****-0-0",
      "RequestTime": "2023-04-12T04:46:38Z",
      "Server": "i-bp1db1****8uemejio",
      "ClientIp": "i-bp1db****38uemejio",
      "ClientPort": 0,
      "DbName": "test_db",
      "UserName": "test_user",
      "SqlType": "select",
      "PlanId": 0,
      "AffectedRows": 10000,
      "ReturnRows": 0,
      "PartitionCount": 1,
      "RetCode": 0,
      "WaitEvent": "none",
      "WaitTime": 0,
      "WaitCount": 0,
      "RpcCount": 8,
      "PlanType": "LOCAL",
      "Inner": false,
      "ExecutorRpc": true,
      "HitPlan": true,
      "ElapsedTime": 2182.66,
      "CpuTime": 3377.57,
      "NetTime": 0,
      "NetWaitTime": 0,
      "QueueTime": 0.02,
      "DecodeTime": 0,
      "GetPlanTime": 0.19,
      "ExecuteTime": 8262.01,
      "ApplicationWaitTime": 0,
      "ConcurrencyWaitTime": 0,
      "UserIoWaitTime": 0,
      "ScheduleTime": 0,
      "RowCacheHit": 498,
      "BloomFilterCacheHit": 0,
      "BlockCacheHit": 99279,
      "BlockIndexCacheHit": 142514,
      "DiskReads": 96972,
      "RetryCount": 0,
      "TableScan": false,
      "ConsistencyLevel": "3",
      "MemstoreReadRows": 0,
      "ExpectedWorkerCount": 0,
      "UsedWorkerCount": 0,
      "SsstoreReadRows": 986190,
      "ObServerId": 2,
      "ObUserId": 100010,
      "ObDbId": 0,
      "Statement": "select a from b",
      "TransHash": "1219****927****73791",
      "FullSqlText": "select * from test where c1 > 1 and c2 > 3;",
      "SqlText": "select ** from t",
      "ParamsValue": "1****",
      "SqlId": "",
      "SqlTextShort": ""
    }
  ]
}

錯誤碼

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情