機能の概要
指定されたSQLステートメントについて、指定された期間内の実行履歴の傾向データを照会するために使用します。これには、平均実行時間、リソース消費量、キャッシュヒット率、実行計画の分布などの主要なパフォーマンス指標が含まれます。
呼び出しの説明
インターフェース制約
呼び出し元はマルチクラウドAPIにアクセスするためのキーを持っている必要があります。AccessKey IDとAccessKey Secretの取得方法については、アクセスキーの管理をご参照ください。
リクエストパス
GET /api/v2/open/instances/{instanceId}/tenants/{tenantId}/sqls/{sqlId}/trends
リクエストパラメータ
Path
パラメータ名 |
型 |
必須 |
説明 |
例 |
|---|---|---|---|---|
| instanceId | String | はい | OceanBaseクラウドデータベースインスタンスID | obcluster-***** |
| tenantId | String | はい | テナントID | t4louaeei**** |
| sqlId | String | はい | SQLステートメントの一意の識別子 | sql_123456789 |
Query
パラメータ名 |
型 |
必須 |
説明 |
例 |
|---|---|---|---|---|
| requestId | String | はい | リクエストID。追跡に使用されます | dc302d76-66b5-48d8-ab53-a035******** |
| startTime | String | はい | クエリ開始時刻 (UTC形式) | 2026-02-25 15:40:43+00:00 |
| endTime | String | はい | クエリ終了時刻 (UTC形式) | 2026-02-26 10:40:43+00:00 |
| dbName | String | はい | データベース名 | test_db |
| nodeIp | String | いいえ | ノードIP | 10.0.0.1 |
| dynamicSql | Boolean | いいえ | 動的SQLかどうか | true |
実行結果
パラメータ名 |
型 |
説明 |
例 |
|---|---|---|---|
| data | Object | データ | {} |
| dataList | Array | データリスト | [] |
| avgAffectedRows | Double | 期間内の平均更新行数 | 0.0 |
| avgApplicationWaitTime | Double | クライアント待機時間内の平均 Application イベント待機時間(ミリ秒) | 0.0 |
| avgBlockCacheHit | Double | 期間内の平均 BlockCache ヒット数 | 0.0 |
| avgBlockIndexCacheHit | Double | 期間内の平均 BlockIndexCache ヒット数 | 0.0 |
| avgBloomFilterCacheHit | Double | 期間内の平均 BloomFilterCache ヒット数 | 0.0 |
| avgConcurrencyWaitTime | Double | 期間内の平均 Concurrency イベント待機時間 | 0.0 |
| avgCpuTime | Double | 期間内の平均 CPU 時間(ミリ秒) | 444.86 |
| avgDbTime | Double | 平均データベース時間(ミリ秒) | 444.87 |
| avgDecodeTime | Double | 期間内の平均構文解析時間(ミリ秒) | 0.0 |
| avgDiskReads | Double | 期間内の平均物理読み取り回数 | 0.0 |
| avgElapsedTime | Double | 期間内の平均応答時間(ミリ秒) | 450.71 |
| avgExecuteTime | Double | 期間内の平均プラン実行時間(ミリ秒) | 444.82 |
| avgExecutorRpcCount | Double | 期間内の平均 RPC リクエスト実行回数 | 0.0 |
| avgGetPlanTime | Double | 期間内の平均プラン生成時間(ミリ秒) | 0.04 |
| avgLogicalReads | Double | 平均論理読み取り | 0.0 |
| avgMemstoreReadRows | Double | 期間内の平均 Memstore 読み取り行数 | 0.0 |
| avgNetTime | Double | 期間内の平均ネットワーク転送時間(ミリ秒) | 0.0 |
| avgNetWaitTime | Double | ネットワーク待機時間内の平均ネットワークキューイン時間(ミリ秒) | 0.0 |
| avgPartitionCount | Double | 期間内の平均パーティション数 | 1.0 |
| avgQueueTime | Double | 期間内の平均待ち行列時間(ミリ秒) | 5.85 |
| avgReturnRows | Double | 期間内平均返却行数 | 0.52 |
| avgRowCacheHit | Double | 期間内の平均 RowCache ヒット数 | 0.0 |
| avgRpcCount | Double | 期間内の平均 RPC リクエスト回数 | 0.0 |
| avgScheduleTime | Double | スケジューリング時間内の平均 Schedule イベント待機時間(ミリ秒) | 0.0 |
| avgSsstoreReadRows | Double | 期間内の平均 SsStore 読み取り行数 | 271.99 |
| avgUserIoWaitTime | Double | 期間内の平均 UserIO イベント待機時間(ミリ秒) | 0.0 |
| avgWaitCount | Double | 期間内の平均待機回数 | 0.0 |
| avgWaitTime | Double | 期間内の平均待機時間(ミリ秒) | 0.0 |
| dbName | String | データベース名 | test11 |
| distPlanPercentage | Double | 分散計画の割合 | 0.0 |
| execPs | Double | 実行 PS の割合 | 4.15 |
| executions | Long | 実行回数 | 249 |
| failCount | Long | 失敗回数 | 0 |
| failPercentage | Double | 失敗率 | 0.0 |
| localPlanPercentage | Double | ローカル計画の割合 | 100.0 |
| maxCpu Time | Double | 最大 CPU 時間(ミリ秒) | 1949.68 |
| maxElapsedTime | Double | 最大応答時間(ミリ秒) | 1956.43 |
| missPlanPercentage | Double | プラン未ヒット率 | 0.0 |
| missPlans | Long | プラン未ヒット数 | 0 |
| remotePlanPercentage | Double | リモート計画の割合 | 0.0 |
| remotePlans | Long | リモート計画数 | 0 |
| retCode4012Count | Long | 戻り値コード 4012 の回数 | 0 |
| retCode4013Count | Long | 戻り値コード 4013 の回数 | 0 |
| retCode5001Count | Long | 戻り値コード 5001 の回数 | 0 |
| retCode5024Count | Long | 戻り値コード 5024 の回数 | 0 |
| retCode5167Count | Long | 戻り値コード 5167 の回数 | 0 |
| retCode5217Count | Long | 戻り値コード 5217 の回数 | 0 |
| retCode6002Count | Long | 戻り値コード 6002 の回数 | 0 |
| retryCount | Long | リトライ回数 | 0 |
| server | String | サーバー名 | i-uf******** |
| serverIp | String | サーバーIPアドレス | xx.xx.xx.xx |
| strongConsistencyPercentage | Double | 強い一貫性の割合 | 100.0 |
| sumDbTime | Double | データベース時間の合計(ミリ秒) | 110771.68 |
| sumElapsedTime | Double | 応答時間の合計(ミリ秒) | 112227.44 |
| sumLogicalReads | Double | 論理読み取りの合計 | 0.0 |
| sumWaitTime | Double | 待機時間の合計(ミリ秒) | 0.0 |
| tableScanPercentage | Double | テーブルスキャンの割合 | 100.0 |
| timestamp | String | タイムスタンプ | 2025-12-23T06:48:08Z |
| userName | String | ユーザー名 | test_mysql |
| waitEvent | String | 待機イベント | none |
| weakConsistencyPercentage | Double | 弱い一貫性の割合 | 0.0 |
例
リクエスト例
curl --digest -u '<Your AK:SK>' \
-X GET \
'https://api-cloud.oceanbase.com/api/v2/open/instances/{instanceId}/tenants/{tenantId}/sqls/{sqlId}/trends?requestId={requestId}&startTime={startTime}&endTime={endTime}&dbName={dbName}&nodeIp={nodeIp}&dynamicSql={dynamicSql}'
レスポンス例
JSON形式
{
"data": {
"dataList": [
{
"avgAffectedRows": 0.0,
"avgApplicationWaitTime": 0.0,
"avgBlockCacheHit": 0.0,
"avgBlockIndexCacheHit": 0.0,
"avgBloomFilterCacheHit": 0.0,
"avgConcurrencyWaitTime": 0.0,
"avgCpuTime": 444.86,
"avgDbTime": 444.87,
"avgDecodeTime": 0.0,
"avgDiskReads": 0.0,
"avgElapsedTime": 450.71,
"avgExecuteTime": 444.82,
"avgExecutorRpcCount": 0.0,
"avgGetPlanTime": 0.04,
"avgLogicalReads": 0.0,
"avgMemstoreReadRows": 0.0,
"avgNetTime": 0.0,
"avgNetWaitTime": 0.0,
"avgPartitionCount": 1.0,
"avgQueueTime": 5.85,
"avgReturnRows": 0.52,
"avgRowCacheHit": 0.0,
"avgRpcCount": 0.0,
"avgScheduleTime": 0.0,
"avgSsstoreReadRows": 271.99,
"avgUserIoWaitTime": 0.0,
"avgWaitCount": 0.0,
"avgWaitTime": 0.0,
"dbName": "test11",
"distPlanPercentage": 0.0,
"execPs": 4.15,
"executions": 249,
"failCount": 0,
"failPercentage": 0.0,
"localPlanPercentage": 100.0,
"maxCpuTime": 1949.68,
"maxElapsedTime": 1956.43,
"missPlanPercentage": 0.0,
"missPlans": 0,
"remotePlanPercentage": 0.0,
"remotePlans": 0,
"retCode4012Count": 0,
"retCode4013Count": 0,
"retCode5001Count": 0,
"retCode5024Count": 0,
"retCode5167Count": 0,
"retCode5217Count": 0,
"retCode6002Count": 0,
"retryCount": 0,
"server": "xxx.xxx.x.xxx:xxxx",
"serverIp": "xx.xx.xx.xx",
"strongConsistencyPercentage": 100.0,
"sumDbTime": 110771.68,
"sumElapsedTime": 112227.44,
"sumLogicalReads": 0.0,
"sumWaitTime": 0.0,
"tableScanPercentage": 100.0,
"timestamp": "2025-12-23T06:48:08Z",
"userName": "test_mysql",
"waitEvent": "none",
"weakConsistencyPercentage": 0.0
}
],
"total": 1
},
"requestId": "87b69bed-98e9-455d-a68d-268105d3a954",
"success": true
}