Hey there,
Yeah what you'll want to do is update the IPageRetriever
query to page the results.
Usually on the frontend you'd also only display 10-20 at a time and include a list of pages or a load more button.
To do that it would look something like this:
int currentPageIndex = 0; //Youd pass this in as an argument - perhaps via a ?currentPage=X query string
const int pageSize = 20; //This would be set once and is up to you
int totalRecords = 0; //This is set to the actual number of records down below.
var results = pageRetriever.Retrieve<Part>(query => {
query.Columns(...); //Your existing Columns line
query.Page(currentPageIndex, pageSize); //This is the key line
totalRecords = query.TotalRecords; //This field will give you the actual count in the database without retrieving them all (So in your case this would be set to 9000.
});
Then all you need to do as you want records, you change the currentPageIndex. In this example itd get the first 20 of 9000 results, but if it was 1, it would return the 21st to 40th items, and so on
This will be substantially faster than getting all 9000 at once.