Skip to content

Commit ba1bb20

Browse files
authored
Merge pull request #3317 from PasswordIsMyPassword/#3314-High-Duplicate-Plan-Percent
#3314 sp_BlitzCache high percentage of duplicate plans
2 parents 1aff099 + a79a9dd commit ba1bb20

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sp_BlitzCache.sql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,8 +1616,7 @@ WITH total_plans AS
16161616
SELECT
16171617
COUNT_BIG(qs.query_plan_hash) AS duplicate_plan_hashes
16181618
FROM sys.dm_exec_query_stats qs
1619-
LEFT JOIN sys.dm_exec_procedure_stats ps
1620-
ON qs.sql_handle = ps.sql_handle
1619+
LEFT JOIN sys.dm_exec_procedure_stats ps ON qs.plan_handle = ps.plan_handle
16211620
CROSS APPLY sys.dm_exec_plan_attributes(qs.plan_handle) pa
16221621
WHERE pa.attribute = N'dbid'
16231622
AND pa.value <> 32767 /*Omit Resource database-based queries, we're not going to "fix" them no matter what. Addresses #3314*/

0 commit comments

Comments
 (0)