首页 > 解决方案 > 为什么即使启用了 MySQL 查询缓存也没有使用?

问题描述

mysql> SHOW VARIABLES LIKE 'have_query_cache';
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| have_query_cache | YES   |
+------------------+-------+
1 row in set (0.00 sec)

mysql> SHOW STATUS LIKE 'Qcache%';
+-------------------------+------------+
| Variable_name           | Value      |
+-------------------------+------------+
| Qcache_free_blocks      | 1          |
| Qcache_free_memory      | 1031832    |
| Qcache_hits             | 0          |
| Qcache_inserts          | 0          |
| Qcache_lowmem_prunes    | 0          |
| Qcache_not_cached       | 3097998155 |
| Qcache_queries_in_cache | 0          |
| Qcache_total_blocks     | 1          |
+-------------------------+------------+
8 rows in set (0.00 sec)

缓存没有被使用有什么原因吗?

标签: mysqlquery-cache

解决方案


推荐阅读