Note
This view is available starting with V4.0.0.
Overview
Displays the overall status of each plan cache for the current tenant on the current OBServer node.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | Tenant ID |
| SVR_IP | varchar(46) | NO | Server IP Address |
| SVR_PORT | bigint(20) | NO | Server Port Number |
| SQL_NUM | bigint(20) | NO | Number of SQL Statements Involved in Plan Cache |
| MEM_USED | bigint(20) | NO | Memory Used by Plan Cache, in Bytes |
| MEM_HOLD | bigint(20) | NO | Memory Held by Plan Cache, in Bytes |
| ACCESS_COUNT | bigint(20) | NO | Number of Queries Accessing Plan Cache |
| HIT_COUNT | bigint(20) | NO | Number of Hits in Plan Cache |
| HIT_RATE | bigint(20) | NO | Plan Cache Hit Rate |
| PLAN_NUM | bigint(20) | NO | Number of Plans |
| MEM_LIMIT | bigint(20) | NO | The maximum memory for the plan cache, in bytes. |
| HASH_BUCKET | bigint(20) | NO | Number of Buckets in Plan Cache Hash Map |
| STMTKEY_NUM | bigint(20) | NO | Number of stmt_keys in plan_cache |
Sample query
In the user tenant, view the overall status of the plan cache for the current tenant on the current node.
obclient [oceanbase]> SELECT * FROM oceanbase.V$OB_PLAN_CACHE_STAT;
The query result is as follows:
+-----------+----------------+----------+---------+----------+----------+--------------+-----------+----------+----------+-----------+-------------+-------------+
| TENANT_ID | SVR_IP | SVR_PORT | SQL_NUM | MEM_USED | MEM_HOLD | ACCESS_COUNT | HIT_COUNT | HIT_RATE | PLAN_NUM | MEM_LIMIT | HASH_BUCKET | STMTKEY_NUM |
+-----------+----------------+----------+---------+----------+----------+--------------+-----------+----------+----------+-----------+-------------+-------------+
| 1002 | 11.xxx.xxx.xxx | 28825 | 462 | 5906439 | 75497472 | 4828434 | 4824966 | 99 | 462 | 214748360 | 49157 | 0 |
+-----------+----------------+----------+---------+----------+----------+--------------+-----------+----------+----------+-----------+-------------+-------------+
1 row in set
