Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
The GV$OB_KVCACHE view displays information about the KV cache on all OBServer nodes.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| SVR_IP | varchar(46) | NO | The IP address of the OBServer node. |
| SVR_PORT | bigint(20) | NO | The port number of the OBServer node. |
| TENANT_ID | bigint(20) | NO | The ID of the tenant. |
| CACHE_NAME | varchar(128) | NO | The name of the cache item. |
| PRIORITY | bigint(20) | NO | The priority. |
| CACHE_SIZE | bigint(20) | NO | The cache size. |
| HIT_RATIO | decimal(38,3) | NO | The hit rate. |
| TOTAL_PUT_CNT | bigint(20) | NO | The number of puts. |
| TOTAL_HIT_CNT | bigint(20) | NO | The number of hits. |
| TOTAL_MISS_CNT | bigint(20) | NO | The number of misses. |
Sample query
A user queries the KVcache information of the user tenant on each OBServer node in the tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_KVCACHE;
The query result is as follows:
+----------------+----------+-----------+-----------------------+----------+------------+-----------+---------------+---------------+----------------+
| SVR_IP | SVR_PORT | TENANT_ID | CACHE_NAME | PRIORITY | CACHE_SIZE | HIT_RATIO | TOTAL_PUT_CNT | TOTAL_HIT_CNT | TOTAL_MISS_CNT |
+----------------+----------+-----------+-----------------------+----------+------------+-----------+---------------+---------------+----------------+
| 172.xx.xxx.xxx | 2882 | 1002 | index_block_cache | 10 | 72824832 | 99.545 | 20906 | 5627353 | 25711 |
| 172.xx.xxx.xxx | 2882 | 1002 | user_block_cache | 1 | 759478272 | 99.907 | 25314 | 29799447 | 27674 |
| 172.xx.xxx.xxx | 2882 | 1002 | user_row_cache | 1 | 12483584 | 62.578 | 5048 | 15100 | 9030 |
| 172.xx.xxx.xxx | 2882 | 1002 | fuse_row_cache | 1 | 6241280 | 99.815 | 497 | 759998 | 1405 |
| 172.xx.xxx.xxx | 2882 | 1002 | storage_meta_cache | 10 | 297544704 | 99.844 | 60664 | 38776523 | 60766 |
| 172.xx.xxx.xxx | 2882 | 1002 | tx_data_kv_cache | 2 | 6241280 | 100.000 | 2 | 55810 | 0 |
| 172.xx.xxx.xxx | 2882 | 1002 | log_kv_cache | 1 | 2632168448 | 0.000 | 39208 | 0 | 0 |
| 172.xx.xxx.xxx | 2882 | 1002 | opt_table_stat_cache | 1 | 6241280 | 91.495 | 472 | 42517 | 3952 |
| 172.xx.xxx.xxx | 2882 | 1002 | opt_column_stat_cache | 1 | 22887424 | 81.099 | 6688 | 187198 | 43628 |
| 172.xx.xxx.xxx | 2882 | 1002 | opt_ds_stat_cache | 1 | 6241280 | 90.110 | 9 | 82 | 9 |
| 172.xx.xxx.xxx | 2882 | 1002 | opt_system_stat_cache | 1 | 6241280 | 100.000 | 2 | 5263 | 0 |
+----------------+----------+-----------+-----------------------+----------+------------+-----------+---------------+---------------+----------------+
11 rows in set