Created
May 4, 2021 15:51
-
-
Save ankona/d66a2534a3f78a2f44bcad39e31975ea to your computer and use it in GitHub Desktop.
get some poorly performing queries & their query plans
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
-- Thanks to: https://blobeater.blog/2019/11/20/execution-plans-in-azure-sql-database/ | |
SELECT top 10 (total_logical_reads/execution_count) as ReadsPerExec, | |
(total_logical_writes/execution_count) as WritesPerExec, | |
(total_physical_reads/execution_count) PhyReadsPerExec, | |
Execution_count, sql_handle, plan_handle, total_worker_time | |
FROM sys.dm_exec_query_stats | |
ORDER BY (total_logical_reads + total_logical_writes) Desc | |
SELECT * FROM sys.dm_exec_query_plan (0x060028007491E823E0C7342EC101000001000000000000000000000000000000000000000000000000000000) | |
/* | |
select top 1 * FROM sys.dm_exec_query_stats | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment