I'm using Entity Framework 5, and I'm executing a query that returns a relatively large resultset, around 30,000 rows. The query itself executes very fast, taking only around 700ms.
After building the linq query I call query.Load();
, and then return DataContext.Set<MyType>.Local
as an ObservableCollection
to the caller. The results are displayed in an editable grid.
The problem is with the query.Load();
call - it's taking around 60 seconds, which is way too long. I'm guessing that this is where EF transforms the results into .NET objects? I've tried profiling, but it won't go any deeper than IQueryable.Load
:/
Any ideas how can I improve performance?
BTW, I tried upgrading to EF6 to see if that helped any, but it actually got worse, wih query.Load();
typically taking 100 seconds!