如何找到 SQL Server 2008 中性能最差的查询?
我找到了以下示例,但它似乎不起作用:
SELECT TOP 5 obj.name, max_logical_reads, max_elapsed_time
FROM sys.dm_exec_query_stats a
CROSS APPLY sys.dm_exec_sql_text(sql_handle) hnd
INNER JOIN sys.sysobjects obj on hnd.objectid = obj.id
ORDER BY max_logical_reads DESC
摘自:
http://www.sqlservercurry.com/2010/03/top-5-costly-stored-procedures-in-sql.html