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

Add configurable limit for counting #631

Closed
jmduque opened this issue Apr 1, 2021 · 1 comment
Closed

Add configurable limit for counting #631

jmduque opened this issue Apr 1, 2021 · 1 comment
Assignees
Labels
s: duplicate This issue or pull request already exists

Comments

@jmduque
Copy link

jmduque commented Apr 1, 2021

pop/finders.go

Line 350 in 5a8f51c

tmpQuery.limitResults = 0

Right now go-buffalo does not support counting with a limit, this causes that in paginated queries for tables with millions of items, no matter how small amount of items we query per page, the time to execute the query will be directly proportional to the amount of items within the table, and in some extremes, we can see paginated queries take just milliseconds to query the items while taking minutes to query the count.

I propose to have a way to either configure the Paginator model to include a property such as MaxPageCount that is used to limit the amount of pages we count while paginating, as most user facing cases, users will never paginate beyond i.e., 99 pages.

@sio4 sio4 added proposal A suggestion for a change, feature, enhancement, etc s: triage Some tests need to be run to confirm the issue labels Sep 20, 2022
@sio4 sio4 added this to the Backlog milestone Sep 20, 2022
@sio4
Copy link
Member

sio4 commented Sep 24, 2022

It seems like this is a duplication of #394, which is on the backlog. I am going to close this issue, please check the linked issue for future updates.

@sio4 sio4 closed this as completed Sep 24, 2022
@sio4 sio4 removed this from the Backlog milestone Sep 24, 2022
@sio4 sio4 added s: duplicate This issue or pull request already exists and removed proposal A suggestion for a change, feature, enhancement, etc s: triage Some tests need to be run to confirm the issue labels Sep 24, 2022
@sio4 sio4 self-assigned this Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants