I have a query that is running very slow the execution plan tells me it is spending a lot of time on a hash match. What can I do to make it faster?select COUNT(DISTINCT p.personnelID)FROM directivegroup g left join dbo.PersonnelGroup dgpon g.AgyGroupID_FK = dgp.AgyGroupID_FK inner join #TempPersonGroup pon p.personnelID = dgp.PersonnelID_FK OR p.personnelID = g.PersonnelID_FK-- from #TempPersonGroup pg -- inner join directivegroup dg -- on dg.AgyGroupID_FK = pg.AgyGroupID -- OR dg.PersonnelID_FK = pg.PersonnelIDinner join testresult tron tr.PersonnelID_FK = p.PersonnelID where tr.passed =1AND tr.AgencyID_FK = @AgencyID and g.directiveID_FK = d.directiveIDAND tr.directiveID_FK = d.directiveID