Entity Framework Skip/Take is very slow when number to skip is big

You are right on that, Skip().Take() approach is slow on SQL server. When I noticed that I used another approach and it worked good. Instead of using Linq Skip().Take() – which writes the code you showed – , I explicitly write the SQL as:

select top NTake ... from ... order by ... where orderedByValue > lastRetrievedValue 

this one works fast (considering I have index on the ordered by column(s)).

Leave a Comment