Adding plan index in file info (#1501)

This commit is contained in:
Aasim Khan
2022-05-19 13:52:02 -07:00
committed by GitHub
parent 8ba8b35d41
commit 25f5f024dd
3 changed files with 12 additions and 4 deletions

View File

@@ -19,14 +19,15 @@ namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan
public static List<ExecutionPlanGraph> CreateShowPlanGraph(string xml, string fileName)
{
ShowPlanGraph[] graphs = ShowPlanGraph.ParseShowPlanXML(xml, ShowPlan.ShowPlanType.Unknown);
return graphs.Select(g => new ExecutionPlanGraph
return graphs.Select((g, index) => new ExecutionPlanGraph
{
Root = ConvertShowPlanTreeToExecutionPlanTree(g.Root),
Query = g.Statement,
GraphFile = new ExecutionPlanGraphInfo
{
GraphFileContent = xml,
GraphFileType = "xml"
GraphFileType = "xml",
PlanIndexInFile = index
},
Recommendations = ParseRecommendations(g, fileName)
}).ToList();