public override List <MissingIndexDetails> GetMissingIndexes(string rawPlan) { var document = XDocument.Parse(rawPlan); var missingIndexGroups = document.Descendants(PlanXmlNamespace.WithName("MissingIndexGroup")); var result = from missingIndexGroup in missingIndexGroups let missingIndexes = missingIndexGroup.Descendants(PlanXmlNamespace.WithName("MissingIndex")) let indexes = from missingIndex in missingIndexes let columnGroups = missingIndex.Descendants(PlanXmlNamespace.WithName("ColumnGroup")) let equalityColumns = (from columnGroup in columnGroups where columnGroup.AttributeValue("Usage") == "EQUALITY" from column in columnGroup.Descendants() select column.AttributeValue("Name")) let inequalityColumns = (from columnGroup in columnGroups where columnGroup.AttributeValue("Usage") == "INEQUALITY" from column in columnGroup.Descendants() select column.AttributeValue("Name")) let includeColumns = (from columnGroup in columnGroups where columnGroup.AttributeValue("Usage") == "INCLUDE" from column in columnGroup.Descendants() select column.AttributeValue("Name")) select new MissingIndexDetails { Impact = Convert.ToDouble(missingIndexGroup.AttributeValue("Impact")), Database = missingIndex.AttributeValue("Database"), Table = missingIndex.AttributeValue("Table"), Schema = missingIndex.AttributeValue("Schema"), EqualityColumns = new List <string>(equalityColumns), InequalityColumns = new List <string>(inequalityColumns), IncludeColumns = new List <string>(includeColumns) } from index in indexes select index; return(result.ToList()); }