Use this query:
Query q = new Query("select top 100 SomeClass objects");
As far as I remember, there is no way to specify .Skip
-like condition in case with DO39, so you should do this manually (e.g. by applying .Skip
to enumerable you've got).
There is an obvious performance impact in this case, but it isn't essential in terms of computational complexity. The only effect of this is that more rows will be sent by SQL Server to the client, but all the other the job it must do remains the same.
An example illustrating this:
if you'll ask Google to show you 1000th page of result, it will anyway
find all the document related to your query, compute match rank for
each of them, sort it to get at least first 1000 of pages with best
match ranks and only after all this job it will be able to give you
1000th page.
So if there is 1,000,000,000,000 of documents, the computational
complexity of sending 10K rows to the client is tiny in comparison
with all the other job done.
Also note that the whole idea of paging is to show a tiny fraction of the whole set of data. So if your user needs to paginate to e.g. 1000th page, there is something wrong with design. There are just two cases:
- User must get a tiny fraction of data (i.e. perform some search)
- User must get all the data (e.g. to make a backup)
There are no intermediate cases.