com_select :
当查询发生,而在缓存中没有命中(是对sql语句做检查,字符区分大小写)。此值加一。
当查询的数据发生变化时,比如某行被update了,那么同一个查询,也会认为没有命中,此值加一。
Qcache_hits:
当查询发生,在缓存中命中,此值加一。
Qcache_inserts:
有新的sql语句,则此值加一。(sql_no_cache时,此值不加)
当查询的数据发生变化时,比如某行被update了,那么同一个查询,也会认为是新查询,此值加一。
qps=com_select+qcache_hits
当sql语句在使用变量时,mysql认为不是新的sql语句,但是也不能命中,所以增加com_select,而对Qcache_hits和Qcache_inserts
不做变化。
=============
TPS – Transactions Per Second(每秒传输的事物处理个数),即服务器每秒处理的事务数,如果是InnoDB会显示,没有InnoDB就不会显示。
TPS = (COM_COMMIT + COM_ROLLBACK)/UPTIME
use information_schema;
select VARIABLE_VALUE into @num_com from GLOBAL_STATUS where VARIABLE_NAME =’COM_COMMIT’;
select VARIABLE_VALUE into @num_roll from GLOBAL_STATUS where VARIABLE_NAME =’COM_ROLLBACK’;
select VARIABLE_VALUE into @uptime from GLOBAL_STATUS where VARIABLE_NAME =’UPTIME’;
select (@num_com+@num_roll)/@uptime;
QPS – Queries Per Second(每秒查询处理量)MyISAM 引擎
QUESTIONS/UPTIME
use information_schema;
select VARIABLE_VALUE into @num_queries from GLOBAL_STATUS where VARIABLE_NAME =’QUESTIONS’;
select VARIABLE_VALUE into @uptime from GLOBAL_STATUS where VARIABLE_NAME =’UPTIME’;
select @num_queries/@uptime;