From b6630945332fbb7251f3ee3b315b4998ca7df406 Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Thu, 12 Mar 2026 13:44:29 -0400 Subject: [PATCH] Fix RetrievedFromCache always showing False (#88) RetrievedFromCache is an attribute on the StmtSimple XML element, but the parser was reading it from the child QueryPlan element where it never exists. Changed to read from stmtEl instead of queryPlanEl. Co-Authored-By: Claude Opus 4.6 --- src/PlanViewer.Core/Services/ShowPlanParser.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PlanViewer.Core/Services/ShowPlanParser.cs b/src/PlanViewer.Core/Services/ShowPlanParser.cs index 01bfcd8..0f04675 100644 --- a/src/PlanViewer.Core/Services/ShowPlanParser.cs +++ b/src/PlanViewer.Core/Services/ShowPlanParser.cs @@ -409,7 +409,7 @@ private static void ParseQueryPlanElements(PlanStatement stmt, XElement stmtEl, stmt.CachedPlanSizeKB = ParseLong(queryPlanEl.Attribute("CachedPlanSize")?.Value); stmt.DegreeOfParallelism = (int)ParseDouble(queryPlanEl.Attribute("DegreeOfParallelism")?.Value); stmt.NonParallelPlanReason = queryPlanEl.Attribute("NonParallelPlanReason")?.Value; - stmt.RetrievedFromCache = queryPlanEl.Attribute("RetrievedFromCache")?.Value is "true" or "1"; + stmt.RetrievedFromCache = stmtEl.Attribute("RetrievedFromCache")?.Value is "true" or "1"; stmt.CompileTimeMs = ParseLong(queryPlanEl.Attribute("CompileTime")?.Value); stmt.CompileMemoryKB = ParseLong(queryPlanEl.Attribute("CompileMemory")?.Value); stmt.CompileCPUMs = ParseLong(queryPlanEl.Attribute("CompileCPU")?.Value);