Note
This view is available starting with V4.0.0.
Purpose
This view displays the overall status of the PS cache for all tenants on all OBServer nodes, including the hit rate, memory usage, and the number of cached items.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The tenant ID. |
| SVR_IP | varchar(46) | NO | The IP address of the server. |
| SVR_PORT | bigint(20) | NO | The port number of the server. |
| STMT_COUNT | bigint(20) | NO | The number of statements cached in the PS cache. |
| HIT_COUNT | bigint(20) | NO | The total number of hits in the PS cache. |
| ACCESS_COUNT | bigint(20) | NO | The total number of accesses to the PS cache. |
| MEM_HOLD | bigint(20) | NO | The amount of memory occupied by the PS cache. |
Sample query
In the sys tenant, query the overall status of the PS cache for all tenants on all nodes.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_PS_STAT;
The query result is as follows:
+-----------+----------------+----------+------------+-----------+--------------+----------+
| TENANT_ID | SVR_IP | SVR_PORT | STMT_COUNT | HIT_COUNT | ACCESS_COUNT | MEM_HOLD |
+-----------+----------------+----------+------------+-----------+--------------+----------+
| 1 | 11.xxx.xxx.xxx | 28825 | 1 | 0 | 1 | 16384 |
| 1 | 11.xxx.xxx.xxx | 28825 | 1 | 0 | 1 | 16384 |
| 1002 | 11.xxx.xxx.xxx | 28825 | 1 | 0 | 1 | 16384 |
| 1002 | 11.xxx.xxx.xxx | 28825 | 1 | 0 | 1 | 16384 |
| 1002 | 11.xxx.xxx.xxx | 28825 | 1 | 0 | 1 | 16384 |
| 1002 | 11.xxx.xxx.xxx | 28825 | 1 | 0 | 1 | 16384 |
| 1002 | 11.xxx.xxx.xxx | 28825 | 1 | 0 | 1 | 16384 |
+-----------+----------------+----------+------------+-----------+--------------+----------+
7 rows in set
