How can I make following query execute faster. This query actually followed by two 'foreach' loops and another query inside. Database contains heaps of records, so it will be grateful if you could help me in executing this query faster.
Thank you in advance
var hours = from hr in objHours.Distinct()
where hr.AssignedId == assignId && hr.JobId == j.JID && hr.CatId == j.CatId.ToInt() && hr.Date.Year == DateTime.Now.Year
orderby hr.TID descending