mysql有没有办法查看或计算一条查询语句的IO是多少???

解决方案 »

  1.   

    set profiling=1;
    select * from tb;
    ...
    ...
    show profile block io for query N;
      

  2.   

    恩 我知道有profile这个 但是我的版本是5.0.27,还不支持,有其他方法么??
      

  3.   

    楼上的不错
    另外可以开始前执行
    flush status;
    yoursql;
    show status;有很多状态变量可以查看,如:
    Bytes_received
    Bytes_sent
    Last_query_cost 这个值*4k 就是随机读取的数据量
      

  4.   

    show status 中有很多 read, write的参数可以体现。