If i test it Select * from TableName where Id = 257 then i get one record and query execute in some seconds, but when Select * from TableName then it shows thousand of records and it takes more than 3 minutes to execute.
I am using this statement in entity framework and i get timeout exception always:
TableName tbl= db.TableName.Where(o => o.ID == 257).FirstOrDefault();
Does it first selects all records from db and then apply where on it, thats why it is taking much time or there is any other reason?
Please guide me.
Thanks.