Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
The V$OB_PLAN_CACHE_STAT view displays the overall status of each plan cache on the current OBServer node of the current tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| SVR_IP | VARCHAR2(46) | NO | The IP address of the OBServer node. |
| SVR_PORT | NUMBER(38) | NO | The port number of the OBServer node. |
| SQL_NUM | NUMBER(38) | NO | The number of SQL statements in the plan cache. |
| MEM_USED | NUMBER(38) | NO | The size of memory that the plan cache occupies. |
| MEM_HOLD | NUMBER(38) | NO | The size of memory that the plan cache holds. |
| ACCESS_COUNT | NUMBER(38) | NO | The number of times that the query accesses the plan cache. |
| HIT_COUNT | NUMBER(38) | NO | The number of plan cache hits. |
| HIT_RATE | NUMBER(38) | NO | The hit rate of the plan cache. |
| PLAN_NUM | NUMBER(38) | NO | The number of plans. |
| MEM_LIMIT | NUMBER(38) | NO | The maximum size of memory that the plan cache can occupy. |
| HASH_BUCKET | NUMBER(38) | NO | The number of buckets in the hash map of the plan cache. |
| STMTKEY_NUM | NUMBER(38) | NO | The number of stmt_keys in the plan cache. |
Sample query
View the overall plan cache status of the current tenant on the current node in the user tenant.
obclient [SYS]> SELECT * FROM SYS.V$OB_PLAN_CACHE_STAT;
The query result is as follows:
+----------------+----------+---------+----------+----------+--------------+-----------+----------+----------+-----------+-------------+-------------+
| SVR_IP | SVR_PORT | SQL_NUM | MEM_USED | MEM_HOLD | ACCESS_COUNT | HIT_COUNT | HIT_RATE | PLAN_NUM | MEM_LIMIT | HASH_BUCKET | STMTKEY_NUM |
+----------------+----------+---------+----------+----------+--------------+-----------+----------+----------+-----------+-------------+-------------+
| 11.xxx.xxx.xxx | 28825 | 478 | 12725826 | 88080384 | 5381438 | 5377607 | 99 | 478 | 214748360 | 49157 | 0 |
+----------------+----------+---------+----------+----------+--------------+-----------+----------+----------+-----------+-------------+-------------+
1 row in set