Overview
The GV$OB_PLAN_CACHE_PLAN_EXPLAIN view displays the physical execution plans cached in the plan cache across all OBServer nodes.
Note
This view supports only the GET operation. When querying, you must specify the IP, PORT, TENANT_ID, and PLAN_ID fields.
Columns
Field |
Type |
Nullable |
Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | Tenant ID |
| SVR_IP | varchar(46) | NO | Server IP Address |
| SVR_PORT | bigint(20) | NO | Server Port Number |
| PLAN_ID | bigint(20) | NO | Plan ID |
| PLAN_DEPTH | bigint(20) | NO | Depth of Operator Display |
| PLAN_LINE_ID | bigint(20) | NO | Operator ID |
| OPERATOR | varchar(128) | NO | Operator name |
| NAME | varchar(256) | NO | Table name |
| ROWS | bigint(20) | NO | Estimated Number of Result Rows |
| COST | bigint(20) | NO | Estimated Cost |
| PROPERTY | varchar(4096) | NO | Information about the corresponding operator |
Sample query
Query the
PLAN_IDof the current OBServer node through the GV$OB_PLAN_CACHE_PLAN_STAT view.obclient [oceanbase]> SELECT PLAN_ID FROM oceanbase.GV$OB_PLAN_CACHE_PLAN_STAT limit 2;The query result is as follows:
+---------+ | PLAN_ID | +---------+ | 605 | | 607 | +---------+ 2 rows in set (0.010 sec)Taking
PLAN_ID=605as an example, query the physical execution plan in the plan cache through theGV$OB_PLAN_CACHE_PLAN_EXPLAINview.obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_PLAN_CACHE_PLAN_EXPLAIN WHERE PLAN_ID = 605\GThe query result is as follows:
*************************** 1. row *************************** TENANT_ID: 1002 SVR_IP: xx.xx.xx.xx SVR_PORT: 2882 PLAN_ID: 605 PLAN_DEPTH: 0 PLAN_LINE_ID: 0 OPERATOR: PHY_TABLE_SCAN NAME: __all_balance_task ROWS: 1 COST: 2 PROPERTY: table_rows:1, physical_range_rows:1, logical_range_rows:1, index_back_rows:0, output_rows:1, avaiable_index_name[__all_balance_task] 1 row in set (0.000 sec)