LINQ String Slower than LINQ Int?
-
Friday, November 16, 2012 10:22 AM
I have a simple join that works, and at the end I have either:
where string == string
this takes about 2 minutes on a database with 44 million records.
If I however search on the int column
where int == int
the query takes seconds? On the same db with the same number of records?
Are there any reasons for this?
All Replies
-
Friday, November 16, 2012 5:14 PM
One of the fields could be indexed and the other not.
LS
Lloyd Sheen
-
Saturday, November 17, 2012 1:48 PM
Basically it's not about LINQ cause, your where condition is finally translated into SQL Statement and operation is performed in SQL and of course, search by varchar will be slower than int.Please mark as reply if helped.
Also visit my blog http://msguy.net/- Proposed As Answer by Alexander SunModerator Monday, November 19, 2012 1:50 AM
- Marked As Answer by Alexander SunModerator Friday, December 07, 2012 2:44 AM

