Get SQL execution details¶
View the complete information of a SQL execution record to confirm the statement content, execution status, time consumption and error information. By default, only records executed by the current identity are viewed. When you have the corresponding permissions, you can view records in the workspace scope.
POST $CLOUDSIGMA_API_BASE/query/detail
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare personal access token and current workspace ID with current workspace access rights. First query the SQL execution record, select the record to be analyzed and record its statement ID and execution time.
Request body¶
Replace $CLOUDSIGMA_API_KEY, $WORKSPACE_ID, $STATEMENT_ID in the example with actual values.
curl -X POST "$CLOUDSIGMA_API_BASE/query/detail" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"statement_id": "'"$STATEMENT_ID"'",
"start": "2026-08-26T09:44:00Z",
"end": "2026-08-26T09:46:00Z"
}'
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string or null |
No |
View the records of the current identity or current workspace. Values: empty string, |
|
string |
Yes |
The statement ID of the selected SQL execution record. Cannot be empty. |
|
string |
Yes |
Query start time, using RFC 3339 format with time zone. |
|
string |
Yes |
Query end time, using RFC 3339 format with time zone. |
The start and end times use the RFC 3339 string with time zone, for example 2026-08-21T07:00:00Z. Detailed and scheduled queries retain the local time and microsecond precision of the input and extend the range by 1 seconds before and after. Lists and overviews are converted to UTC whole seconds.
View range
scope value |
Viewable records |
Permission conditions. |
|---|---|---|
self |
A record of current identity. |
Default scope. |
workspace |
Workspace scope records. |
Workspace audit read permission is required. |
Specify query time range
The start and end time must be filled in at the same time and overwrite the execution time of the selected record. For example, when the list displays 2026-08-26T09:45:35Z, you can use 2026-08-26T09:44:00Z to The time range of 2026-08-26T09:46:00Z.
Use selected execution record
Populate the Statement ID field with the statement ID of the selected record. Fill in the start and end time, and the range must cover the recorded execution time.
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"statement_id": "5c6f22fb-ef0e-4f46-b06f-c31e1a7afb48",
"transaction_id": "txn-01",
"session_id": "session-01",
"account": "acc01",
"user": "analyst",
"host": "127.0.0.1",
"database": "analytics",
"statement": "SELECT 1 AS n",
"request_at": "2026-08-26T09:45:35Z",
"response_at": "2026-08-26T09:45:36Z",
"duration": 1000000,
"status": "Success",
"statement_type": "Select",
"query_type": "DQL",
"sql_source_type": "cloud_user_sql",
"result_count": 1
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
Statement ID. |
|
string |
Transaction ID. |
|
string |
Session ID. |
|
string |
Account used for execution. |
|
string |
Executing user. |
|
string |
Execution host. |
|
string |
The database used during execution. |
|
string |
SQL statement text. |
|
string |
Statement label. |
|
string |
Sentence fingerprint. |
|
string |
Execution node UUID. |
|
string |
Execution node type. |
|
string |
Start execution time. |
|
string |
End execution time. |
|
integer |
Execution duration, in nanoseconds. |
|
string |
execution status. |
|
string |
error code. |
|
string |
error message. |
|
string |
Saved execution plan. |
|
integer |
Read the number of lines. |
|
integer |
Number of bytes to scan. |
|
string |
Statement type. |
|
string |
Statement category. |
|
integer |
Execution role ID. |
|
string |
SQL source type. |
|
integer |
Number of result rows. |
|
number |
Capacity usage. |
|
integer |
Database connection ID. |
When you need to view the execution plan, use the same statement ID and time range query SQL execution plan. If you need to re-execute, after confirming the SQL content, target database and current identity permissions, use Execute SQL.
Error response¶
{
"code": "ErrParamInvalid",
"msg": "请求参数无效"
}
Field |
Type |
Description |
|---|---|---|
code |
string |
error code. |
msg |
string |
error message. |