What are the principles or implementation involved in making a result set from a database "pageable" ?
How is it possible to page over a million records without storing it in memory? What allows "jumping" from 5 to the 50th page number when there are 100 pages ?
I'm looking for a pseudo-code kind of explanation on how the paging is accomplished.
Basic premise is to remember the following:
PAGE_SIZE
)var numPages = totalNumRecords / PAGE_SIZE;
Page = 1
Skip((page - 1)*PAGE_SIZE).Take(PAGE_SIZE);
So what will happen is when you hit the data source for results, you will skip to the set of records you want and take the prescribed amount. Hopefully this makes sense.