命中率=Qcache_hits/(Qcache_hits+Com_select)Com_select:mysql> show global status like '%com_select%'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | Com_select | 1 | +---------------+-------+ 1 row in set (0.00 sec)mysql>
你们楼上的人都是傻比吗!没看到: mysql> show global status like '%com_select%'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | Com_select | 1 | +---------------+-------+ 1 row in set (0.00 sec)com_select值为1!!!!!!操!!!
我看到的 mysql> show status like '%Qcache_hits%'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | Qcache_hits | 0 | +---------------+-------+ 1 row in set (0.00 sec) 这怎么算....
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Com_select | 1 |
+---------------+-------+
1 row in set (0.00 sec)mysql>
2。每条记录的头部保存的是该记录的总长度,因为虽然定义了长度但其实际长度均不尽相同,MYSQL第一个字段保存的是表的主键,第二个字段保存锁ID,用于表数据的加过和回滚,其长度固定的是13个字节。
3。不要经常的更新数据,因为更新相当于删除以前的,然后再追加一条记录。以上分别都能影响命中率,还有表的数据不是连续存储的,是根据整个数据表数据插入的先后存储的。以上希望有帮助,谢谢。
mysql> show global status like '%com_select%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Com_select | 1 |
+---------------+-------+
1 row in set (0.00 sec)com_select值为1!!!!!!操!!!
mysql> show status like '%Qcache_hits%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Qcache_hits | 0 |
+---------------+-------+
1 row in set (0.00 sec)
这怎么算....