From d4f2e99653f97d64bb25ce39f3541e56c5773731 Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Thu, 12 Mar 2026 13:49:18 -0400 Subject: [PATCH] Fix RetrievedFromCache always showing False 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 in both Dashboard and Lite copies. Ported from PerformanceStudio#88 / PerformanceStudio#89. Co-Authored-By: Claude Opus 4.6 --- Dashboard/Services/ShowPlanParser.cs | 2 +- Lite/Services/ShowPlanParser.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dashboard/Services/ShowPlanParser.cs b/Dashboard/Services/ShowPlanParser.cs index bdc8a980..00668790 100644 --- a/Dashboard/Services/ShowPlanParser.cs +++ b/Dashboard/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); diff --git a/Lite/Services/ShowPlanParser.cs b/Lite/Services/ShowPlanParser.cs index 82add3c4..b30fb0f1 100644 --- a/Lite/Services/ShowPlanParser.cs +++ b/Lite/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);