Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit number of (pages of) results #657

Open
JasonBarnabe opened this issue Jan 7, 2024 · 1 comment
Open

Limit number of (pages of) results #657

JasonBarnabe opened this issue Jan 7, 2024 · 1 comment

Comments

@JasonBarnabe
Copy link

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.

@BishnuPandey
Copy link

As, limiting the results is up to the service that consumes data, it is tricky. Would you please attach the screenshot and size of data the query returned. Also, the difference in time that 1st page take vs 20th page would be helpful. Hope that would help refine the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants