本文共 2285 字,大约阅读时间需要 7 分钟。
mysql>SHOW GLOBAL STATUS LIKE 'QCACHE%';+-------------------------+----------+| Variable_name | Value |+-------------------------+----------+| Qcache_hits | 0 || Qcache_not_cached | 1 || Qcache_queries_in_cache | 0 |+-------------------------+----------+mysql>SELECT * FROM `Weather` WHERE `AddTime` = 1185897600;
mysql>SHOW GLOBAL STATUS LIKE 'QCACHE%';+-------------------------+----------+| Variable_name | Value |+-------------------------+----------+| Qcache_hits | 0 || Qcache_not_cached | 2 || Qcache_queries_in_cache | 1 |+-------------------------+----------+mysql>SELECT * FROM `Weather` WHERE `AddTime` = 1185897600;
mysql>SHOW GLOBAL STATUS LIKE 'QCACHE%';+-------------------------+----------+| Variable_name | Value |+-------------------------+----------+| Qcache_hits | 1 || Qcache_not_cached | 3 || Qcache_queries_in_cache | 1 |+-------------------------+----------+mysql>SELECT * FROM `Weather` WHERE `AddTime` = DATE_FORMAT(NOW(), '%Y-%m-%d');
mysql>SHOW GLOBAL STATUS LIKE 'QCACHE%';+-------------------------+----------+| Variable_name | Value |+-------------------------+----------+| Qcache_hits | 1 || Qcache_not_cached | 5 || Qcache_queries_in_cache | 1 |+-------------------------+----------+mysql>SELECT * FROM `Weather` WHERE `AddTime` = DATE_FORMAT(NOW(), '%Y-%m-%d');
mysql>SHOW GLOBAL STATUS LIKE 'QCACHE%';+-------------------------+----------+| Variable_name | Value |+-------------------------+----------+| Qcache_hits | 1 || Qcache_not_cached | 7 || Qcache_queries_in_cache | 1 |+-------------------------+----------+