We are seeing some ‘bad’ queries in our database causing high CPU utilization and causing SQL performance issues. We want to add an index on the activitylog table. In analyzing with SQL profiler we found the following query to be a problem
SELECT EntryType,EntryClass,BriefMessage,FullMessage, RelatedDocID,RelatedPartnerID,B2BUser, EntryTimestamp,RelatedInstanceID FROM ActivityLog WHERE RelatedDocID = @P1 AND EntryType = 0
Can we add an index to improve the performance or is there another recommendation?