Making sense of the number of reads/writes in SQL Profiler

前端 未结 1 1690
被撕碎了的回忆
被撕碎了的回忆 2021-02-09 06:21

\"alt

See the SQL Statements indicated in this SQL Profiler view. All these events are coming from one Clie

1条回答
  •  醉话见心
    2021-02-09 06:38

    The Reads/Writes figures given for the Audit:Logout event are the cumulative totals for the duration of that connection. In itself, the values don't tell you any detail - if you run 10 commands within the lifetime of a connection, you'll be seeing the total figures for all 10 commands within that session.

    To know what the breakdown was by statement, you need to look at the SQL:BatchCompleted (or SQL:StmtCompleted) events that are recorded for that same SPID between the starting Audit:Login event, and the ending Audit:Logout event.

    Update: Looking at the image, the thing that looks a bit odd (to me at least), is that after each Audit:Logout, the Reads value is not reset, and so each time it is being incremented by the number of reads for the statement being executed (17). I'm not sure 100% therefore at what point that figure will be reset - but the basic point is that the figure is cumulative and could have been built up over time/a number of statements so doesn't necessarily mean you have a heavy query hitting the server!

    I suspect that Reads/Writes figures for Audit:Logout are behaving cumulatively as above. But the Duration bucks that trend. It looks like Duration is not cumulative. Some descriptions from MSDN:

    Duration : Amount of time since the user logged in (approximately).
    Reads: Number of logical read I/Os issued by the user during the connection.
    Writes: Number of logical write I/Os issued by the user during the connection.

    0 讨论(0)
提交回复
热议问题