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

Prevent big page offset #38

Closed
hei-teacher opened this issue Jan 26, 2022 · 1 comment
Closed

Prevent big page offset #38

hei-teacher opened this issue Jan 26, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@hei-teacher
Copy link
Member

Our current pagination is translated into offset-limit pagination by Postgres.
The more P=page*pageSize increase, the longer Postgres takes to process the request.
In particular, P could lead to a full scan.
To prevent this, P should be bounded.
Eg: P_MAX=1_000 ensures that a query will never scan more than P_MAX+MAX_PAGE_SIZE.
P_MAX=1_000 is large enough to cover all the use cases of the API.
* We don't expect consumers to dump the whole database
* Consumers are only expected to find users by weak comparison on
* ref
* firstname
* name

@hei-teacher hei-teacher added the bug Something isn't working label Jan 26, 2022
@hei-teacher
Copy link
Member Author

Use the BoundedPageSize for pagination.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants