メインコンテンツまでスキップ
バージョン: Latest-4.0

Query detail API

Query detail APIは、FE メモリにキャッシュされている最近の実行されたクエリの詳細を返します。

注記

Query detail レコードは、FE 構成の enable_collect_query_detail_infotrue に設定されている場合にのみ収集されます。

エンドポイント

  • GET /api/query_detail(v1)
  • GET /api/v2/query_detail(v2、is_request_all_frontend をサポートし、ラップされた結果を返します)

パラメータ

名前必須デフォルト説明
event_timeはい-下限フィルタ条件。eventTime がこの値より大きいレコードを返します。0 を指定するとすべてのキャッシュ済みレコードを返します。
userいいえ-user フィールドでフィルタします(大文字・小文字を区別しません)。
is_request_all_frontendいいえ(v2のみ)falsetrue の場合、現在の FE が他の稼働中 FE に問い合わせ、結果をマージします。

レスポンス

  • v1 は QueryDetail 配列を返します。
  • v2 は { "code": "0", "message": "OK", "result": [ ... ] } を返し、result が QueryDetail 配列です。

認証と権限

本 API は HTTP Basic 認証 を必要とします。

ログインに成功すれば追加の権限制御は行われません。認証済みユーザーは、user フィルタを指定しない限り、すべてのキャッシュ済みクエリ詳細を参照できます。

QueryDetail フィールド

フィールド名説明
queryIdstringクエリ ID。
eventTimelongフィルタに使用される内部タイムスタンプ(ウォールクロック由来の単調増加ナノ秒)。
isQuerybooleanクエリ文かどうか。
remoteIPstringクライアント IP アドレス、または System
connIdintコネクション ID。
startTimelongクエリ開始時刻(エポックからのミリ秒)。
endTimelongクエリ終了時刻(エポックからのミリ秒)。未完了の場合は -1
latencylongクエリレイテンシ(ミリ秒)。未完了の場合は -1
pendingTimelongPending 状態の時間(ミリ秒)。
netTimelong正味実行時間(ミリ秒)。
netComputeTimelong正味計算時間(ミリ秒)。
statestringクエリ状態:RUNNINGFINISHEDFAILEDCANCELLED
databasestring現在のデータベース。
sqlstringSQL 文(設定によりマスキングされる場合があります)。
userstringログインユーザー(完全修飾ユーザー名)。
impersonatedUserstringEXECUTE AS の対象ユーザー。未使用時は null
errorMessagestringクエリ失敗時のエラーメッセージ。
explainstringExplain プラン(query_detail_explain_level により制御)。
profilestring収集されている場合の Profile 情報。
resourceGroupNamestringリソースグループ名。
scanRowslongスキャンした行数。
scanByteslongスキャンしたデータ量(バイト)。
returnRowslong返却された行数。
cpuCostNslongCPU 使用時間(ナノ秒)。
memCostByteslongメモリ使用量(バイト)。
spillByteslongスピルされたデータ量(バイト)。
cacheMissRatiofloatキャッシュミス率(%、0–100)。
warehousestringWarehouse 名。
digeststringSQL ダイジェスト。
catalogstringCatalog 名。
commandstringMySQL コマンド名。
preparedStmtIdstringプリペアドステートメント ID。
queryFeMemorylongクエリが FE 上で使用したメモリ量(バイト)。
querySourcestringクエリの発生元:EXTERNALINTERNALMVTASK

v1

curl -u root: "http://<fe_host>:<fe_http_port>/api/query_detail?event_time=0"

v2

curl -u root: "http://<fe_host>:<fe_http_port>/api/v2/query_detail?event_time=0&is_request_all_frontend=true"
Rocky the happy otterStarRocks Assistant

AI generated answers are based on docs and other sources. Please test answers in non-production environments.