From 910378e00faac541603bb3c1f62d88a1f67f665e Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Wed, 4 Mar 2026 17:56:51 -0500 Subject: [PATCH] Fix RID Lookup analyzer rule to match new PhysicalOp label The Key Lookup parser fix (PR #413) changes PhysicalOp from "RID Lookup" to "RID Lookup (Heap)". The analyzer rule used exact equality which no longer matched. Changed to StartsWith. Co-Authored-By: Claude Opus 4.6 --- Dashboard/Services/PlanAnalyzer.cs | 2 +- Lite/Services/PlanAnalyzer.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dashboard/Services/PlanAnalyzer.cs b/Dashboard/Services/PlanAnalyzer.cs index 69be6509..8effd575 100644 --- a/Dashboard/Services/PlanAnalyzer.cs +++ b/Dashboard/Services/PlanAnalyzer.cs @@ -459,7 +459,7 @@ private static void AnalyzeNode(PlanNode node, PlanStatement stmt) // Rule 10: Key Lookup / RID Lookup with residual predicate // Check RID Lookup first — it's more specific (PhysicalOp) and also has Lookup=true - if (node.PhysicalOp == "RID Lookup") + if (node.PhysicalOp.StartsWith("RID Lookup", StringComparison.OrdinalIgnoreCase)) { var message = "RID Lookup — this table is a heap (no clustered index). SQL Server found rows via a nonclustered index but had to follow row identifiers back to unordered heap pages. Heap lookups are more expensive than key lookups because pages are not sorted and may have forwarding pointers. Add a clustered index to the table."; if (!string.IsNullOrEmpty(node.Predicate)) diff --git a/Lite/Services/PlanAnalyzer.cs b/Lite/Services/PlanAnalyzer.cs index 9ba4fe6f..6ac33d40 100644 --- a/Lite/Services/PlanAnalyzer.cs +++ b/Lite/Services/PlanAnalyzer.cs @@ -459,7 +459,7 @@ private static void AnalyzeNode(PlanNode node, PlanStatement stmt) // Rule 10: Key Lookup / RID Lookup with residual predicate // Check RID Lookup first — it's more specific (PhysicalOp) and also has Lookup=true - if (node.PhysicalOp == "RID Lookup") + if (node.PhysicalOp.StartsWith("RID Lookup", StringComparison.OrdinalIgnoreCase)) { var message = "RID Lookup — this table is a heap (no clustered index). SQL Server found rows via a nonclustered index but had to follow row identifiers back to unordered heap pages. Heap lookups are more expensive than key lookups because pages are not sorted and may have forwarding pointers. Add a clustered index to the table."; if (!string.IsNullOrEmpty(node.Predicate))