Skip to content

Commit 81d0105

Browse files
committed
Fix incorrect column reference in update
I think when Jeremiah was experimenting with optimizations, he didn't finish changing column names. Several of them were referencing QueryPlan in our global temp table rather than query_plan in our local temp tables, so the XML wasn't parsing correctly, and we were missing plan information. I was able to remove the forced serialization check from further down.
1 parent a3a112f commit 81d0105

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

sp_BlitzCache.sql

+3-4
Original file line numberDiff line numberDiff line change
@@ -1615,9 +1615,9 @@ SET missing_index_count = query_plan.value('count(/p:QueryPlan/p:MissingInde
16151615
CompileTime = query_plan.value('sum(/p:QueryPlan/@CompileTime)', 'float') ,
16161616
CompileCPU = query_plan.value('sum(/p:QueryPlan/@CompileCPU)', 'float') ,
16171617
CompileMemory = query_plan.value('sum(/p:QueryPlan/@CompileMemory)', 'float') ,
1618-
implicit_conversions = CASE WHEN QueryPlan.exist('/p:QueryPlan/p:Warnings/p:PlanAffectingConvert/@Expression[contains(., "CONVERT_IMPLICIT")]') = 1 THEN 1 END ,
1619-
plan_warnings = CASE WHEN QueryPlan.value('count(/p:QueryPlan/p:Warnings)', 'int') > 0 THEN 1 END,
1620-
is_forced_serial = CASE WHEN QueryPlan.value('count(/p:QueryPlan/@NonParallelPlanReason)', 'int') > 0 THEN 1 END
1618+
implicit_conversions = CASE WHEN query_plan.exist('/p:QueryPlan/p:Warnings/p:PlanAffectingConvert/@Expression[contains(., "CONVERT_IMPLICIT")]') = 1 THEN 1 END ,
1619+
plan_warnings = CASE WHEN query_plan.value('count(/p:QueryPlan/p:Warnings)', 'int') > 0 THEN 1 END,
1620+
is_forced_serial = CASE WHEN query_plan.value('count(/p:QueryPlan/@NonParallelPlanReason)', 'int') > 0 THEN 1 END
16211621
FROM #query_plan qp
16221622
WHERE qp.QueryHash = ##bou_BlitzCacheProcs.QueryHash
16231623
OPTION (RECOMPILE);
@@ -1693,7 +1693,6 @@ SET NumberOfDistinctPlans = distinct_plan_count,
16931693
unmatched_index_count = QueryPlan.value('count(//p:UnmatchedIndexes/p:Parameterization/p:Object)', 'int') ,
16941694
plan_multiple_plans = CASE WHEN distinct_plan_count < number_of_plans THEN 1 END ,
16951695
is_trivial = CASE WHEN QueryPlan.exist('//p:StmtSimple[@StatementOptmLevel[.="TRIVIAL"]]/p:QueryPlan/p:ParameterList') = 1 THEN 1 END ,
1696-
is_forced_serial = CASE WHEN QueryPlan.value('count(//p:QueryPlan/@NonParallelPlanReason)', 'int') > 0 THEN 1 END,
16971696
SerialDesiredMemory = QueryPlan.value('sum(//p:MemoryGrantInfo/@SerialDesiredMemory)', 'float') ,
16981697
SerialRequiredMemory = QueryPlan.value('sum(//p:MemoryGrantInfo/@SerialRequiredMemory)', 'float'),
16991698
CachedPlanSize = QueryPlan.value('sum(//p:QueryPlan/@CachedPlanSize)', 'float') ,

0 commit comments

Comments
 (0)