• The Code posted is tough but the attached Word document is very good. I think they just cut&pasted the Word text into the post and that just does not work 🙂

    The real value is the discussion in the Word document which would make a much better article than the posted code.

    Ian has done a nice job providing insight into a very useful DMV that I have not looked at before. I do have one caution on the subject. The Average and delta that Ian calculates are a fairly simple view of performance change. The technique will not give an accurate indication of changes for queries that tend to have a highly variable runtime. For example assume a stored procedure that checks a queue for work. 3 or 4 times in 5 it finds nothing to do and runs in less than a tick. Occassionally it finds work and takes 10 to 15 ms. In a case like this the Average is misleading.

    Ian's queries provide a nice starting point for monitoring queries, but you really need to add some historical and trend data for each query to get the whole picture.

    Thanks Ian for highlighting the DMV for me.