博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

监控

Posted on 2016-07-04 21:31  moss_tan_jun  阅读(192)  评论(0编辑  收藏  举报

任环境离不开监控,如果少了监控,有可能就会陷入盲人摸象。 推荐zabbix+mpm构建监控。

http://blog.itpub.net/30109892/viewspace-1815109/

 

Extra有时候会显示“Select tables optimized away”,意思是没有更好的可优化的了。官方解释For explains on simple count queries (i.e. explain select count(*) from people) the extra section will read "Select tables optimized away." This is due to the fact that MySQL can read the result directly from the table internals and therefore does not need to perform the select.

---MySQL对于“Select tables optimized away”的含义, 不是"没有更好的可优化的了", 官方解释中关键的地方在于:

MySQL can read the result directly

所以,合理的解释是: 1 数据已经在内存中可以直接读取; 2 数据可以被认为是一个经计算后的结果,如函数或表达式的值; 3 一旦查询的结果被优化器"预判"可以不经执行就可以得到结果,所以才有"not need to perform the select". 

 

 

3 如何区分是使用了哪种优化策略?

 

 

 

策略名称

查询执行计划显示项

说明

半连接策略

SHOW WARNINGS命令显示内容

semi join

 

物化策略

select_type

SUBQUERY/SIMPLE

 

SHOW WARNINGS命令显示内容

<materialize>(query fragment)

非半连接的物化,即物化策略中的物化

select_type

MATERIALIZED

被物化策略物化的子查询

EXISTS策略

select_type

DEPENDENT SUBQUERY

DEPENDENT说明了依赖的关系,EXISTS策略把子查询变为了相关子查询