qcache_inserts com_select 与缓存命中率
2016-12-28 16:21
274 查看
高性能MySQL这本书中关于查询缓存有一段这样的描述: Cache invalidations can happen because of fragmentation, insufficient memory, or
data modifications. If you have allocated enough memory to the cache and tuned the
query_cache_min_res_unit value properly, most cache invalidations should be due to
data modifications. You can see how many queries have modified data by examining
the Com_* status variables (Com_update, Com_delete, and so forth), and you can see
how many queries have been invalidated due to low memory by checking the Qcache_
lowmem_prunes status variable. 既然没有命中,肯定要有com_select,读之后要加到缓存中,要有qcache_inserts,既然是这样,我不解的是应该一次com_select就对应一次qcache_inserts阿,为什么qcache_inserts会比com_select小的多呢?原来是这样的: The total number of SELECT queries is given by this formula:Com_select + Qcache_hits+ queries with errors found by parser The Com_select value is given by this formula:Qcache_inserts + Qcache_not_cached + queries with errors found during the column-privileges check 总的select查询数等于com_select(没命中) + qcache_hits(命中) + 解析错误的,其中的com_select等于qcache_inserts(失效) + qcache_not_cache + 权限检查错误的。也就是说qcache_inserts这个计数不是表示没被缓存而进行的读,而是缓存失效而进行的读,没被缓存和缓存失效是两个概念,分别计数,但都会引起com_select。 参考:http://dev.mysql.com/doc/refman/5.0/en/query-cache-status-and-maintenance.htmlhttp://www.wzsky.net/html/article/php/php2/15874.html 还是要认真读官方文档阿。
data modifications. If you have allocated enough memory to the cache and tuned the
query_cache_min_res_unit value properly, most cache invalidations should be due to
data modifications. You can see how many queries have modified data by examining
the Com_* status variables (Com_update, Com_delete, and so forth), and you can see
how many queries have been invalidated due to low memory by checking the Qcache_
lowmem_prunes status variable. 既然没有命中,肯定要有com_select,读之后要加到缓存中,要有qcache_inserts,既然是这样,我不解的是应该一次com_select就对应一次qcache_inserts阿,为什么qcache_inserts会比com_select小的多呢?原来是这样的: The total number of SELECT queries is given by this formula:Com_select + Qcache_hits+ queries with errors found by parser The Com_select value is given by this formula:Qcache_inserts + Qcache_not_cached + queries with errors found during the column-privileges check 总的select查询数等于com_select(没命中) + qcache_hits(命中) + 解析错误的,其中的com_select等于qcache_inserts(失效) + qcache_not_cache + 权限检查错误的。也就是说qcache_inserts这个计数不是表示没被缓存而进行的读,而是缓存失效而进行的读,没被缓存和缓存失效是两个概念,分别计数,但都会引起com_select。 参考:http://dev.mysql.com/doc/refman/5.0/en/query-cache-status-and-maintenance.htmlhttp://www.wzsky.net/html/article/php/php2/15874.html 还是要认真读官方文档阿。
相关文章推荐
- WebApp JS 打开 app
- jenkens构建脚本
- 20个非常有用的Java程序片段
- 《JAVA与模式》之模板方法模式
- 百度BAE应用引擎在Java下的使用
- 201301 JAVA 题目2-3级(0,0)-->(m,n)的棋盘走法
- Android studio的使用(错误bug解决方案)
- Spark编程指南入门之Java篇三-常用Transformations操作
- 如何对包含图片的长文进行分页处理
- EventBus源码学习笔记
- 对于有一定编程基础的学生来说,看下面这个链接的文章比较好
- java poi 生成excel单个或多个表头
- 精进:如何成为一个很厉害的人---书摘
- https://yq.aliyun.com/articles/65125?spm=5176.100240.searchblog.18.afqQoU
- ready与load触发时机
- centos(vm)下安装hive2.1.1单机模式(x86)
- apt-get 安装卸载,wget下载,hg clone克隆
- 列举常用的结构标记,并描述其作用。
- 【C#】—值类型与引用类型
- linux shell “永久环境变量”、“临时环境变量”和普通变量之完全解读