Last active
August 29, 2015 14:05
-
-
Save FreekPaans/312bf8c5e83338acac7f to your computer and use it in GitHub Desktop.
show read queries in sql azure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT TOP 25 | |
q.[text], | |
(total_logical_reads/execution_count) AS avg_logical_reads, | |
(total_logical_writes/execution_count) AS avg_logical_writes, | |
(total_physical_reads/execution_count) AS avg_phys_reads, | |
total_physical_reads, | |
creation_time, | |
last_execution_time, | |
Execution_count, | |
execution_count/ datediff(mi,creation_time,getdate()) as avg_execs_per_minute | |
FROM sys.dm_exec_query_stats | |
cross apply sys.dm_exec_sql_text(plan_handle) AS q | |
ORDER BY | |
total_physical_reads desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment