Overview
Displays the plan information collected by executing EXPLAIN PLAN for all tenants on the current OBServer node.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | Tenant ID of the plan information |
| SQL_ID | varchar(32) | NO | Query ID |
| DB_ID | bigint(20) | NO | Query the ID of the schema to which the object belongs. |
| PLAN_HASH | bigint(20) unsigned | NO | Hash value of the plan |
| PLAN_ID | bigint(20) | Plan ID | |
| GMT_CREATE | timestamp(6) | NO | Record generation time |
| OPERATOR | varchar(255) | NO | Operator name (for example, TABLE SCAN or SORT). |
| OBJECT_NODE | varchar(40) | NO | If the current operator is DBLINK-related, it indicates the name of the dblink. |
| OBJECT_ID | bigint(20) | NO | Scan Object ID (for example, the physical table ID scanned by the TABLE SCAN operator) |
| OBJECT_OWNER | varchar(128) | NO | Owner of the scanned object |
| OBJECT_NAME | varchar(128) | NO | Name of the object being scanned (for example, the name of the physical table scanned by the TABLE SCAN operator). |
| OBJECT_ALIAS | varchar(261) | NO | Scan object alias (for example, the alias of the physical table scanned by the TABLE SCAN operator). |
| OBJECT_TYPE | varchar(20) | NO | Scan Object Type (for example, SYNONYM, DBLINK, BASIC TABLE) |
| OPTIMIZER | varchar(4000) | NO | Index-related information (such as physical rows, logical rows, number of rows retrieved from the table, type of statistics used, and version number of statistics) |
| ID | bigint(20) | NO | Logical Operator ID |
| PARENT_ID | bigint(20) | NO | Parent operator ID of the logical operator |
| DEPTH | bigint(20) | NO | The depth of the logical operator in the current plan, that is, which level it occupies in the binary plan tree. |
| POSITION | bigint(20) | NO | Operator indicating which child node of the parent operator the current logical operator is |
| COST | bigint(20) | NO | Estimated cost by the optimizer |
| REAL_COST | bigint(20) | NO | Actual cost when the plan is executed for the first time (execution feedback information) |
| CARDINALITY | bigint(20) | NO | Number of rows output by the current operator estimated by the optimizer |
| REAL_CARDINALITY | bigint(20) | NO | The actual number of rows output by the current operator during the first execution of the plan (execution feedback information). |
| IO_COST | bigint(20) | NO | The actual I/O overhead of the current operator during the first execution of the plan (execution feedback information). |
| CPU_COST | bigint(20) | NO | The actual CPU cost of the current operator during the first execution of the plan (execution feedback information). |
| BYTES | bigint(20) | NO | Width of data estimated by the optimizer for the current operator |
| ROWSET | bigint(20) | NO | Vectorization Size of the Current Operator |
| OTHER_TAG | varchar(4000) | NO | The hints used in the current query are stored only in the first row of the plan record. |
| PARTITION_START | varchar(4000) | NO | Partition information scanned by TABLE SCAN |
| OTHER | varchar(4000) | NO | Optimization information, such as the plan type, parameterized information of Fast Parser, plan notes, and constraint information hit by the plan. |
| ACCESS_PREDICATES | varchar(4000) | NO | Information about the expressions accessed by the current operator |
| FILTER_PREDICATES | varchar(4000) | NO | Filter condition of the current operator |
| STARTUP_PREDICATES | varchar(4000) | NO | Startup conditions of the current operator |
| PROJECTION | varchar(4000) | NO | Output expression information of the current operator |
| SPECIAL_PREDICATES | varchar(4000) | NO | Information about the specific expressions of the current operator, such as Join Condition, GROUP EXPRS, and SORT EXPRS. |
| QBLOCK_NAME | varchar(128) | NO | The name of the query block where the operator is located. |
| REMARKS | varchar(4000) | NO | Modification tracking information of qb_name |
| OTHER_XML | varchar(4000) | NO | OUTLINE DATA |
Sample query
In the sys tenant, view the plan information collected by executing EXPLAIN PLAN for all tenants on the current OBServer node. Only one record is displayed.
obclient [oceanbase]> SELECT * FROM oceanbase.V$OB_SQL_PLAN LIMIT 1\G
The query result is as follows:
*************************** 1. row ***************************
TENANT_ID: 1
SQL_ID: 359E40D6A4AB75171925325700759325
DB_ID: 500006
PLAN_HASH: 6388442502389984409
PLAN_ID: 28790
GMT_CREATE: 2025-03-26 10:26:41.039836
OPERATOR: EXPRESSION
OBJECT_NODE:
OBJECT_ID: 0
OBJECT_OWNER:
OBJECT_NAME:
OBJECT_ALIAS:
OBJECT_TYPE:
OPTIMIZER:
ID: 0
PARENT_ID: -1
DEPTH: 0
POSITION: 1
COST: 1
REAL_COST: 0
CARDINALITY: 1
REAL_CARDINALITY: 1
IO_COST: 0
CPU_COST: 0
BYTES: 0
ROWSET: 1
OTHER_TAG: /*+
*/
PARTITION_START:
OTHER: Plan Type:
LOCAL
Note:
Degree of Parallelisim is 1 because of table property
ACCESS_PREDICATES:
FILTER_PREDICATES:
STARTUP_PREDICATES:
PROJECTION: output([database()])
SPECIAL_PREDICATES: values({database()})
QBLOCK_NAME: SEL$1
REMARKS: stmt_id:0, SEL$1
OTHER_XML: /*+
BEGIN_OUTLINE_DATA
OPTIMIZER_FEATURES_ENABLE('4.3.5.1')
END_OUTLINE_DATA
*/
1 row in set