Query Cache

回覆文章
yehlu
Site Admin
文章: 3244
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Query Cache

文章 yehlu »

http://dev.mysql.com/doc/refman/5.7/en/query-cache.html

my.cnf

代碼: 選擇全部

query_cache_size = 32M
query_cache_type = 1

代碼: 選擇全部

mysql> SHOW STATUS LIKE 'Qcache%';
+-------------------------+----------+
| Variable_name           | Value    |
+-------------------------+----------+
| Qcache_free_blocks      | 7        |
| Qcache_free_memory      | 23406160 |
| Qcache_hits             | 61343    |
| Qcache_inserts          | 5256     |
| Qcache_lowmem_prunes    | 0        |
| Qcache_not_cached       | 5385     |
| Qcache_queries_in_cache | 1953     |
| Qcache_total_blocks     | 4120     |
+-------------------------+----------+
8 rows in set (0.00 sec)

代碼: 選擇全部

mysql> set global query_cache_type = 0;
Query OK, 0 rows affected (0.00 sec)
mysql> set global query_cache_type = 1;
ERROR 1651 (HY000): Query cache is disabled; restart the server with query_cache_type=1 to enable it
mysql> set global query_cache_type = 2;
ERROR 1651 (HY000): Query cache is disabled; restart the server with query_cache_type=1 to enable it
回覆文章

回到「MySQL」