Depending on the database engine and table size, queries may get more expensive as the OFFSET value gets larger. This results in the query for page 20, for example, executing considerably slower than querying page 2.
To deal with this, is there an option to limit the number of results, or the number of pages of results? For example, if I am showing 50 results per page, to never consider 21 a valid page when loading the results and to never offer a link to page 21, even if those results exist in the DB? In other words, only the first 1000 records would be accessible.
I know that simply redirecting any requests for page 21 back to page 1 or something accomplishes the first part, but then it would still be showing the link to page 21.
To deal with this, is there an option to limit the number of results, or the number of pages of results? For example, if I am showing 50 results per page, to never consider 21 a valid page when loading the results and to never offer a link to page 21, even if those results exist in the DB? In other words, only the first 1000 records would be accessible.
I know that simply redirecting any requests for page 21 back to page 1 or something accomplishes the first part, but then it would still be showing the link to page 21.