Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Dashboard/Controls/PlanViewerControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,8 @@ private void ShowPropertiesPanel(PlanNode node)

// Header
var headerText = node.PhysicalOp;
if (node.LogicalOp != node.PhysicalOp && !string.IsNullOrEmpty(node.LogicalOp))
if (node.LogicalOp != node.PhysicalOp && !string.IsNullOrEmpty(node.LogicalOp)
&& !node.PhysicalOp.Contains(node.LogicalOp, StringComparison.OrdinalIgnoreCase))
headerText += $" ({node.LogicalOp})";
PropertiesHeader.Text = headerText;
PropertiesSubHeader.Text = $"Node ID: {node.NodeId}";
Expand Down Expand Up @@ -1481,7 +1482,8 @@ private ToolTip BuildNodeTooltip(PlanNode node)

// Header
var headerText = node.PhysicalOp;
if (node.LogicalOp != node.PhysicalOp && !string.IsNullOrEmpty(node.LogicalOp))
if (node.LogicalOp != node.PhysicalOp && !string.IsNullOrEmpty(node.LogicalOp)
&& !node.PhysicalOp.Contains(node.LogicalOp, StringComparison.OrdinalIgnoreCase))
headerText += $" ({node.LogicalOp})";
stack.Children.Add(new TextBlock
{
Expand Down
13 changes: 13 additions & 0 deletions Dashboard/Services/ShowPlanParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,19 @@ private static PlanNode ParseRelOp(XElement relOpEl)
node.Lookup = physicalOpEl.Attribute("Lookup")?.Value is "true" or "1";
node.DynamicSeek = physicalOpEl.Attribute("DynamicSeek")?.Value is "true" or "1";

// Override PhysicalOp, LogicalOp, and icon when Lookup=true.
// SQL Server's XML emits PhysicalOp="Clustered Index Seek" with <IndexScan Lookup="1">
// rather than "Key Lookup (Clustered)" — correct the label here so all display
// paths (node card, tooltip, properties panel) show the right operator name.
if (node.Lookup)
{
var isHeap = node.IndexKind?.Equals("Heap", StringComparison.OrdinalIgnoreCase) == true
|| node.PhysicalOp.StartsWith("RID Lookup", StringComparison.OrdinalIgnoreCase);
node.PhysicalOp = isHeap ? "RID Lookup (Heap)" : "Key Lookup (Clustered)";
node.LogicalOp = isHeap ? "RID Lookup" : "Key Lookup";
node.IconName = isHeap ? "rid_lookup" : "bookmark_lookup";
}

// Table cardinality and rows to be read (on <RelOp> per XSD)
node.TableCardinality = ParseDouble(relOpEl.Attribute("TableCardinality")?.Value);
node.EstimatedRowsRead = ParseDouble(relOpEl.Attribute("EstimatedRowsRead")?.Value);
Expand Down
6 changes: 4 additions & 2 deletions Lite/Controls/PlanViewerControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,8 @@ private void ShowPropertiesPanel(PlanNode node)

// Header
var headerText = node.PhysicalOp;
if (node.LogicalOp != node.PhysicalOp && !string.IsNullOrEmpty(node.LogicalOp))
if (node.LogicalOp != node.PhysicalOp && !string.IsNullOrEmpty(node.LogicalOp)
&& !node.PhysicalOp.Contains(node.LogicalOp, StringComparison.OrdinalIgnoreCase))
headerText += $" ({node.LogicalOp})";
PropertiesHeader.Text = headerText;
PropertiesSubHeader.Text = $"Node ID: {node.NodeId}";
Expand Down Expand Up @@ -1492,7 +1493,8 @@ private ToolTip BuildNodeTooltip(PlanNode node)

// Header
var headerText = node.PhysicalOp;
if (node.LogicalOp != node.PhysicalOp && !string.IsNullOrEmpty(node.LogicalOp))
if (node.LogicalOp != node.PhysicalOp && !string.IsNullOrEmpty(node.LogicalOp)
&& !node.PhysicalOp.Contains(node.LogicalOp, StringComparison.OrdinalIgnoreCase))
headerText += $" ({node.LogicalOp})";
stack.Children.Add(new TextBlock
{
Expand Down
13 changes: 13 additions & 0 deletions Lite/Services/ShowPlanParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,19 @@ private static PlanNode ParseRelOp(XElement relOpEl)
node.Lookup = physicalOpEl.Attribute("Lookup")?.Value is "true" or "1";
node.DynamicSeek = physicalOpEl.Attribute("DynamicSeek")?.Value is "true" or "1";

// Override PhysicalOp, LogicalOp, and icon when Lookup=true.
// SQL Server's XML emits PhysicalOp="Clustered Index Seek" with <IndexScan Lookup="1">
// rather than "Key Lookup (Clustered)" — correct the label here so all display
// paths (node card, tooltip, properties panel) show the right operator name.
if (node.Lookup)
{
var isHeap = node.IndexKind?.Equals("Heap", StringComparison.OrdinalIgnoreCase) == true
|| node.PhysicalOp.StartsWith("RID Lookup", StringComparison.OrdinalIgnoreCase);
node.PhysicalOp = isHeap ? "RID Lookup (Heap)" : "Key Lookup (Clustered)";
node.LogicalOp = isHeap ? "RID Lookup" : "Key Lookup";
node.IconName = isHeap ? "rid_lookup" : "bookmark_lookup";
}

// Table cardinality and rows to be read (on <RelOp> per XSD)
node.TableCardinality = ParseDouble(relOpEl.Attribute("TableCardinality")?.Value);
node.EstimatedRowsRead = ParseDouble(relOpEl.Attribute("EstimatedRowsRead")?.Value);
Expand Down
Loading