Description
You can call this operation to query the operator structure of an execution plan. Operator information with an orderly tree structure is returned.
Call description
Prerequisite
You have the read privilege on the specified tenant.
Request path
GET /api/v2/cluters/{clusterId}/tenants/{tenantId}/plans/{uid}/explain
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| clusterId | Integer | Yes | 1 | The ID of the cluster. |
| tenantId | Integer | Yes | 1001 | The ID of the tenant. |
| uid | String | Yes | AAAAAAAAAAEAAAAAAAKOvgAFs1_j8s3i | The UID of the plan. |
| startTime | Datetime | Yes | 2020-02-16T05:32:16+08:00 | The start time. |
| endTime | Datetime | Yes | 2020-02-16T07:32:16+08:00 | The end time. |
Response parameters
Basic data structure
| Parameter | Type | Description |
|---|---|---|
| data | Object | The request data. |
| ├─ rootOperations | Array | The array of the operator. For more information about its data structure, see the following table. |
| successful | Boolean | Whether the request is successful. |
| timestamp | Datetime | The timestamp when the server completes the request. |
| duration | Integer | The time that the server takes to process the request, in milliseconds. |
| status | Integer | The encoding in compliance with the HTTP Status specification. |
| traceId | String | The trace ID of the request. This trace ID is used for troubleshooting. |
| server | String | The address of the application server that responds to the request. |
Data structure of operator
| Parameter | Type | Description |
|---|---|---|
| operator | String | The name of the operator. |
| objectName | String | The object to be operated on. It is generally a table name. |
| rows | Integer | The number of rows to be operated on. |
| cost | Integer | The cost of the operation. |
| property | String | The output and filter of the operation. |
| children | Array | The array of the sub-operation. |
Examples
Sample request
Query the operation structure of the physical execution plan whose UID is AAAAAAAAAAEAAAAAAAAJ_AAFszE_cnfR based on the cluster ID 1 and tenant ID 1001, and set the time range to 2020-11-03T19:00:00+08:00 to 2020-11-03T20:00:00+08:00.
GET /api/v2/ob/clusters/1/tenants/1001/plans/AAAAAAAAAAEAAAAAAAAJ_AAFszE_cnfR/explain?startTime=2020-11-03T19%3A00%3A00%2B08%3A00&endTime=2020-11-03T20%3A00%3A00%2B08%3A00
Sample response
{
"duration": 75,
"server": "xxx.xxx.xxx.xxx",
"status": 200,
"successful": true,
"timestamp": "2020-11-11T11:12:13.216+08:00",
"traceId": "dc7f223f5f7f4ef6",
"data": {
"rootOperations": [
{
"cost": 2024,
"objectName": "NULL",
"operator": "PHY_SCALAR_AGGREGATE",
"property": "NULL",
"rows": 1,
"children": [
{
"cost": 2000,
"objectName": "__all_virtual_memory_info",
"operator": "PHY_TABLE_SCAN",
"property": "table_rows:100000, physical_range_rows:100, logical_range_rows:100, index_back_rows:0, output_rows:100, est_method:basic_stat",
"rows": 100
}
]
}
]
}
}