我的理解时间探查器中writes就是指多少次写操作,
但是为何我的insert,update语句执行时,虽然reads值不为0,但writes的值为何都为0?

解决方案 »

  1.   

    Using Reads, CPU, Duration or Writes for query tuning with SQL Trace
    http://blogs.sqlserver.org.au/blogs/greg_linwood/archive/2006/12/11/492.aspx
    Writes is the last of the major query performance measurements offered by SQL Trace. Whilst it provides some useful information about how many 8kb write a query performed, I rarely find this terribly useful when query tuning as there is little scope for much to go "wrong" with write characteristics. This is a very different picture to Reads because many factors can (& often do) cause query read behaviour to degrade (indexes, statistics etc).
      

  2.   

    sp_trace_setevent
    http://msdn.microsoft.com/en-us/library/aa260314.aspx
    17 Writes Number of physical disk writes performed by the server on behalf of the event. 
      

  3.   

    没错,writes的计数是物理写,是需要触发的。而reads的计数是逻辑读。可以用
    set statistics io on
    --set statistics time on
    来看更细节的io情况
      

  4.   

    writes的计数是物理写我想知道物理写为何为0?
      

  5.   


    偶的理解是write只是写在了cache里, 然后才会有checkpoint. 如果你写的都是物理写的, 要是你想回滚怎么办? 都再物理读一遍?? 显然不是的.
      

  6.   

    “write只是写在了cache里”?我执行的SQL都是单独事务,执行了很多次,但writes都是为0,难道都没有进行物理写?