Get SQL execution profile¶
View the execution plan (Profile) of a SQL to analyze the execution steps and resource usage of the SQL. 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/profile
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/profile" \
-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",
"profile": {
"code": 200,
"message": "NO ExecPlan",
"success": false
}
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
The statement ID in the request. |
|
object |
Execution plan results. |
|
array of object |
List of steps to execute the plan. |
|
object |
Execution plan diagram of steps. |
|
array of object |
Execution nodes and their resource statistics in the execution plan graph. |
|
string |
logo. |
|
string |
Name. |
|
string |
title. |
|
array of object |
Tag mapping. |
|
string |
Name. |
|
string |
Value. |
|
object |
Operational indicators. |
|
array of object or null |
Memory metrics. |
|
string |
Name. |
|
integer |
Value. |
|
string |
unit. |
|
array of object or null |
Throughput metrics. |
|
string |
Name. |
|
integer |
Value. |
|
string |
unit. |
|
array of object or null |
IO indicators. |
|
string |
Name. |
|
integer |
Value. |
|
string |
unit. |
|
array of object or null |
Network indicators. |
|
string |
Name. |
|
integer |
Value. |
|
string |
unit. |
|
object |
Estimate cost. |
|
number |
Start time. |
|
number |
The number of records that match the current query conditions. |
|
number |
Estimated base. |
|
number |
Number of different values. |
|
number |
Estimate row size. |
|
object |
Total operating indicators. |
|
string |
Name. |
|
integer |
Value. |
|
string |
unit. |
|
array of object |
Data flow relationships between execution nodes. |
|
string |
logo. |
|
string |
source node. |
|
string |
target node. |
|
integer |
output. |
|
string |
unit. |
|
array of object |
Annotation information in the execution plan diagram. |
|
string |
Name. |
|
string |
Value. |
|
object |
Summary resource statistics for steps. |
|
object |
Operational indicators. |
|
array of object or null |
Memory metrics. |
|
string |
Name. |
|
integer |
Value. |
|
string |
unit. |
|
array of object or null |
Throughput metrics. |
|
string |
Name. |
|
integer |
Value. |
|
string |
unit. |
|
array of object or null |
IO indicators. |
|
string |
Name. |
|
integer |
Value. |
|
string |
unit. |
|
array of object or null |
Network indicators. |
|
string |
Name. |
|
integer |
Value. |
|
string |
unit. |
|
object |
Total operating indicators. |
|
string |
Name. |
|
integer |
Value. |
|
string |
unit. |
|
integer |
Step number. |
|
string |
Step instructions. |
|
string |
Step status. |
|
integer |
Execution plan status code. Not less than 0. Not larger than 65535. |
|
string |
Execution plan description. NO ExecPlan if there is no saved plan. |
|
boolean |
Whether to obtain an available execution plan. |
|
string |
Execution plan identifier. |
When no execution plan is available, you can use the same statement ID and time range query SQL execution details, and check the SQL text and execution status.
Error response¶
{
"code": "ErrParamInvalid",
"msg": "请求参数无效"
}
Field |
Type |
Description |
|---|---|---|
code |
string |
error code. |
msg |
string |
error message. |