Caritatis

Just another WordPress.com weblog

Awesome SQL Profiler Post July 8, 2011

Filed under: SQL — caritatis @ 2:34 pm
Tags:

I stumbled upon this post while researching computed columns:
Top 10 Hidden Gems in SQL Server 2005

http://technet.microsoft.com/en-us/library/cc917696.aspx

It led me to this post when I was trying to figure out how to use sys.dm_exec_query_stats. Awesome information about “How To Get High Quality Information About Query Performance”

http://sqlblog.com/blogs/elisabeth_redei/archive/2009/03/01/how-to-get-high-quality-information-about-query-performance.aspx

Here’s a quick & dirty sql query:

select    sql_handle, (total_elapsed_time – total_worker_time) as blockedtime,
total_worker_time as cputime,
(total_physical_reads+total_logical_reads+total_logical_writes) as iocycles,
qs.execution_count , text
from  sys.dm_exec_query_stats qs
CROSS APPLY sys.dm_exec_sql_text(sql_handle)
order by blockedtime

Advertisement
 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.