我有一个查询,其中索引搜索(非聚集)占用总执行时间的93%的更多时间.
查询的执行计划,索引查找的估计行数是1,实际行数是209.这是否是问题?
如何提高非聚簇索引的性能.一般性答案将有所帮助.
执行计划:
以下是查询,
SELECT TOP 11 DVPR1.IncidentID,DVPR2.IncidentID,Rel.ID,PER1.[LastName],PER1.[FirstName] FROM DV_PHPersonalRecord DVPR1 INNER JOIN Relationship Rel ON Rel.source_Id = DVPR1.RowId AND Rel.typeCode = 'RPLC' INNER JOIN DV_PHPersonalRecord DVPR2 ON DVPR2.RowId = Rel.target_Id INNER JOIN [T_Attribute] (nolock) ON [T_Attribute].[ActRelationship_ID] = Rel.[ID] AND [T_Attribute].[name] = 'MergeFlag' AND ( [T_Attribute].[valueString_Code] = 'pending') INNER JOIN [Person] PER1 (nolock) ON DVPR1.[PersonDR]=PER1.[RowID] INNER JOIN [Person] PER2 (nolock) ON DVPR2.[PersonDR]=PER2.[RowID] WHERE DVPR1.TypeDR = 718990 AND (PER1.[Code_ID] IS NULL OR ( PER1.[Code_ID] = '6516' AND PER1.[OptionsCode_ID] = '6522') ) AND ( PER2.[Code_ID] IS NULL OR ( PER2.[Code_ID] = '6516' AND PER2.[OptionsCode_ID] = '6522') ) ORDER BY PER1.[LastName] ASC,PER1.[FirstName] ASC