File tree Expand file tree Collapse file tree 1 file changed +6
-18
lines changed
Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -2810,12 +2810,15 @@ SET NumberOfDistinctPlans = distinct_plan_count,
28102810FROM (
28112811 SELECT COUNT (DISTINCT QueryHash) AS distinct_plan_count,
28122812 COUNT (QueryHash) AS number_of_plans,
2813- QueryHash
2813+ QueryHash,
2814+ DatabaseName
28142815 FROM ##BlitzCacheProcs
28152816 WHERE SPID = @@SPID
2816- GROUP BY QueryHash
2817+ GROUP BY QueryHash,
2818+ DatabaseName
28172819) AS x
28182820WHERE ##BlitzCacheProcs .QueryHash = x .QueryHash
2821+ AND ##BlitzCacheProcs .DatabaseName = x .DatabaseName
28192822OPTION (RECOMPILE ) ;
28202823
28212824-- query level checks
@@ -3664,22 +3667,7 @@ END;
36643667
36653668
36663669/* END Testing using XML nodes to speed up processing */
3667- RAISERROR (N ' Gathering additional plan level information' , 0 , 1 ) WITH NOWAIT ;
3668- WITH XMLNAMESPACES(' http://schemas.microsoft.com/sqlserver/2004/07/showplan' AS p)
3669- UPDATE ##BlitzCacheProcs
3670- SET NumberOfDistinctPlans = distinct_plan_count,
3671- NumberOfPlans = number_of_plans,
3672- plan_multiple_plans = CASE WHEN distinct_plan_count < number_of_plans THEN number_of_plans END
3673- FROM (
3674- SELECT COUNT (DISTINCT QueryHash) AS distinct_plan_count,
3675- COUNT (QueryHash) AS number_of_plans,
3676- QueryHash
3677- FROM ##BlitzCacheProcs
3678- WHERE SPID = @@SPID
3679- GROUP BY QueryHash
3680- ) AS x
3681- WHERE ##BlitzCacheProcs .QueryHash = x .QueryHash
3682- OPTION (RECOMPILE );
3670+
36833671
36843672/* Update to grab stored procedure name for individual statements */
36853673RAISERROR (N ' Attempting to get stored procedure name for individual statements' , 0 , 1 ) WITH NOWAIT ;
You can’t perform that action at this time.
0 commit comments