Can someone please suggest me what wrong with this query? How can I improve the performance and decrease the time taken to execute it?
IQueryable<Mapper> query = null;
query = (from c in entities.Users
where c.UserEmailAddress == emailAddress
&& c.UserPassword == password
&& c.IsAccountVerified == true
select new Mapper()
{
UserId= c.UserID,
Name = c.UserName
});
custObj = query.ToList<Mapper>().FirstOrDefault();
I am using EF profiler it alerts me following warning:-
- Query on unindexed column
- Column Type mismatch
- More than one session per request
FYI:-
- EmailAddress - varchar(50) - Non ClusteredIndex
- Password - varchar(max) - No Index
- IsAccountVerified - bool - No Index
Even in local, I notice its taking 2-4 seconds to execute?
Apart from it, is there can someone suggest imp guidelines to fine tune the queries in EF.
I am using EF6.0