1、查询数据库的Select,Insert,Update,Delete执行的频率,以便于设计更好的表的存储引擎和平时哪些sql语句执行的最多.
show [ session | global ] status like ' XXXX '
1.默认的是session,就是当前的窗口
2.global,Mysql启动到开始
2、查询Select的执行频率
show status like 'com_select%'
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Com_select | 7 |
+---------------+-------+
3、查询Insert的执行频率
show status like 'com_insert%' ;
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| Com_insert | 0 |
| Com_insert_select | 0 |
+-------------------+-------+
4、查询Update的执行频率
show status like 'com_update%' ;
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| Com_update | 0 |
| Com_update_multi | 0 |
+------------------+-------+
5、查询Delete的执行频率
show status like 'com_delete%' ;
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| Com_delete | 0 |
| Com_delete_multi | 0 |
+------------------+-------+