Server version: 5.0.67
=================================================我断开mysql服务后,在重新启动 .
执行 set profiling=1;(InnoDB引擎)
然后 select * from table_name;
然后 show profiles ; 取query_id
最后 show profile cpu,block io for query n;
==================================================
此时,我是这样想的,既然我重新断开在连,
那么,我在select的时候,我就要访问硬盘数据,竟然我访问了硬盘数据,我就要用到IO吧..然后从硬盘读取数据放到 buffer pool里面吧。。 那么怎么也要用一下IO吧。。那为什么我在show profile block io for query N; 里面没有看到使用IO的情况呢? IO 显示为null ,,,为什么没有使用IO呢??
======================================================================================
声明:
这是重新启动mysqld之后 第一次使用select。
=========================================================================================
具体操作如下:mysql> use optimizetest
Database changed
mysql> set profiling=1;
Query OK, 0 rows affected (0.00 sec)mysql> select name2 from demo1 where name3 in ('3sinkinto1','3sinkinto2') limit
5;
+------------+
| name2 |
+------------+
| 2sinkinto1 |
| 2sinkinto1 |
| 2sinkinto1 |
| 2sinkinto1 |
| 2sinkinto1 |
+------------+
5 rows in set (0.20 sec)mysql> show profiles\G
*************************** 1. row ***************************
Query_ID: 1
Duration: 0.20212300
Query: select name2 from demo1 where name3 in ('3sinkinto1','3sinkinto2') li
mit 5
1 row in set (0.00 sec)mysql> show profile block io for query 1\G
*************************** 1. row ***************************
Status: starting
Duration: 0.000124
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 2. row ***************************
Status: Opening tables
Duration: 0.200374
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 3. row ***************************
Status: System lock
Duration: 0.000007
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 4. row ***************************
Status: Table lock
Duration: 0.000012
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 5. row ***************************
Status: init
Duration: 0.000069
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 6. row ***************************
Status: optimizing
Duration: 0.000020
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 7. row ***************************
Status: statistics
Duration: 0.000221
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 8. row ***************************
Status: preparing
Duration: 0.000086
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 9. row ***************************
Status: executing
Duration: 0.000009
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 10. row ***************************
Status: Sending data
Duration: 0.000235
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 11. row ***************************
Status: end
Duration: 0.000007
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 12. row ***************************
Status: end
Duration: 0.000004
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 13. row ***************************
Status: query end
Duration: 0.000006
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 14. row ***************************
Status: freeing items
Duration: 0.000935
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 15. row ***************************
Status: closing tables
Duration: 0.000008
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 16. row ***************************
Status: logging slow query
Duration: 0.000003
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 17. row ***************************
Status: cleaning up
Duration: 0.000006
Block_ops_in: NULL
Block_ops_out: NULL
17 rows in set (0.00 sec)=====================================================================================================为什么没有使用IO呢?
=================================================我断开mysql服务后,在重新启动 .
执行 set profiling=1;(InnoDB引擎)
然后 select * from table_name;
然后 show profiles ; 取query_id
最后 show profile cpu,block io for query n;
==================================================
此时,我是这样想的,既然我重新断开在连,
那么,我在select的时候,我就要访问硬盘数据,竟然我访问了硬盘数据,我就要用到IO吧..然后从硬盘读取数据放到 buffer pool里面吧。。 那么怎么也要用一下IO吧。。那为什么我在show profile block io for query N; 里面没有看到使用IO的情况呢? IO 显示为null ,,,为什么没有使用IO呢??
======================================================================================
声明:
这是重新启动mysqld之后 第一次使用select。
=========================================================================================
具体操作如下:mysql> use optimizetest
Database changed
mysql> set profiling=1;
Query OK, 0 rows affected (0.00 sec)mysql> select name2 from demo1 where name3 in ('3sinkinto1','3sinkinto2') limit
5;
+------------+
| name2 |
+------------+
| 2sinkinto1 |
| 2sinkinto1 |
| 2sinkinto1 |
| 2sinkinto1 |
| 2sinkinto1 |
+------------+
5 rows in set (0.20 sec)mysql> show profiles\G
*************************** 1. row ***************************
Query_ID: 1
Duration: 0.20212300
Query: select name2 from demo1 where name3 in ('3sinkinto1','3sinkinto2') li
mit 5
1 row in set (0.00 sec)mysql> show profile block io for query 1\G
*************************** 1. row ***************************
Status: starting
Duration: 0.000124
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 2. row ***************************
Status: Opening tables
Duration: 0.200374
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 3. row ***************************
Status: System lock
Duration: 0.000007
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 4. row ***************************
Status: Table lock
Duration: 0.000012
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 5. row ***************************
Status: init
Duration: 0.000069
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 6. row ***************************
Status: optimizing
Duration: 0.000020
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 7. row ***************************
Status: statistics
Duration: 0.000221
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 8. row ***************************
Status: preparing
Duration: 0.000086
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 9. row ***************************
Status: executing
Duration: 0.000009
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 10. row ***************************
Status: Sending data
Duration: 0.000235
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 11. row ***************************
Status: end
Duration: 0.000007
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 12. row ***************************
Status: end
Duration: 0.000004
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 13. row ***************************
Status: query end
Duration: 0.000006
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 14. row ***************************
Status: freeing items
Duration: 0.000935
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 15. row ***************************
Status: closing tables
Duration: 0.000008
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 16. row ***************************
Status: logging slow query
Duration: 0.000003
Block_ops_in: NULL
Block_ops_out: NULL
*************************** 17. row ***************************
Status: cleaning up
Duration: 0.000006
Block_ops_in: NULL
Block_ops_out: NULL
17 rows in set (0.00 sec)=====================================================================================================为什么没有使用IO呢?
解决方案 »
- mysql:用一条sql语求得ip及pv(访问量)
- 到底是用Insert into 还是update,求一SQL语句
- 求一sql语句的写法,根据表名获取表的结构,包括字段名,字段类别,字段大小,是否主键,希望大虾给与帮助,在线等
- 关于修改MYSQL中字符类型字段的问题
- mysql表里怎么显示中文啊??
- mysql lock
- win2000下因中断了一次mysql的进程,而后每次启动,都说发生中断错误!救命啊!
- 服务器中毒,mysql启动不了
- cluster SQL节点搭建小问题:Could not find ./bin/my_print_defaults
- 再问mysql查询执行过程/顺序
- 如何处理大对象分页
- 为什么要备份数据库,应该怎样备份数据库
=========================
Block_ops_in: NULL
Block_ops_out: NULL
========================
表示什么?
他们不是现实所用的IO数量吗?