So, code is very simple:
var result = dbContext.Skip(x).Take(y).ToList();
When x is big (~1.000.000), query is very slow. y is small - 10, 20.
SQL code for this is: (from sql profiler)
SELECT ...
FROM ...
ORDER BY ...
OFFSET x ROWS FETCH NEXT y ROWS ONLY
The question is if anybody knows how to speed up such paging?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…