Function Description
Queries the operator structure of an execution plan. The result set contains ordered operator information in a tree structure.
Call instructions
Interface constraints
The caller must have the read permission for the specified tenant.
Request path
GET /api/v2/cluters/{clusterId}/tenants/{tenantId}/plans/{uid}/explain
Request parameters
| Parameter | Type | Required | Example Value | 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. |
Return results
Basic data structure
| Parameter | Type | Description |
|---|---|---|
| data | Object | The request data. |
| ├─ data | Array | The array of execution plan operators. The data structure of an execution plan operator is described in the following table. |
| ├─ notEmpty | Boolean | Plan Explain. |
| ├─ planOperationSummery | Array | The array of operation lists. The data structure of an operation list is described in the following table. |
| ├─ rootOperations | Array | The array of operation operators. The data structure of an operation operator is described in the following table. |
| successful | Boolean | Indicates whether the request is successful. |
| timestamp | Datetime | The timestamp when the server finishes the request. |
| duration | Integer | The time taken by the server to process the request (in milliseconds). |
| status | Integer | The HTTP status code that conforms to the HTTP status specification. |
| traceId | String | The Trace ID of the request, which is used for troubleshooting. |
| server | String | The address of the application service that responds to the request. |
Data structure of an execution plan operator
| Parameter | Type | Description |
|---|---|---|
| ClusterName | String | The name of the cluster. |
| CollectTimeUs | Long | The time when the plan is collected (in microseconds). |
| Cost | Integer | The cost of the operator. |
| CreateTime | String | The creation time. |
| FirstLoadTimeUs | Long | The time when the plan is first loaded (in microseconds). |
| Id | Long | The ID of the operator. |
| ObClusterId | Long | The ID of the OceanBase cluster. |
| ObServerId | Long | The server ID of OceanBase. |
| ObTenantId | Long | The ID of the OceanBase tenant. |
| ObjectName | String | The name of the operation target. |
| Operator | String | The logical operator. |
| PlanId | Long | The ID of the execution plan. |
| PlanUnionHash | String | The unique identifier of the plan, which is calculated based on the operations and targets of the plan. |
| Property | String | The output and filtering of the operation. |
| Rows | Long | The estimated number of rows. |
Data structure of an operation list
| Parameter | Type | Description |
|---|---|---|
| operator | String | The logical operator. |
| objectName | String | The operation target. |
Data structure of an operation operator
| Parameter | Type | Description |
|---|---|---|
| operator | String | The name of the operator. |
| objectName | String | The operation target, which is usually the name of a table. |
| rows | Integer | The number of rows operated. |
| cost | Integer | The cost of the operation. |
| property | String | The output and filtering of the operation. |
| children | Array | The array of child operators. |
Example
Request example
Query the operation structure of the physical execution plan with Uid AAAAAAAAAAEAAAAAAAAJ_AAFszE_cnfR in the cluster with Id 1 and tenant with Id 1001, and the plan time range is from 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
Response example
{
"duration": 75,
"server": "a83ad33525",
"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
}
]
}
]
}
}