Entity Framework Performance Inconsistency Compared to Sql Management Studio
- by AndyV
I'm getting timeouts with a very basic EF statement. I'm simply doing a select from a single table with a Entity.Title.StartsWith("test") and a .Take(25). When I run this for a search that returns no results I get a timeout.
If I profile and grab the sql statement it looks fine, and if I run that sql in Management Studio it runs in a fraction of a second!
Why would the same query run sub-second in Management Studio and timeout when generated by EF and called from an Asp.Net app?