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

Improve paging by changing the filter instead of using skip, if an order is specified #721

Open
hylkevds opened this issue Jan 14, 2022 · 1 comment

Comments

@hylkevds
Copy link
Member

hylkevds commented Jan 14, 2022

Skipping rows is slow, since each skipped row still needs to be fully calculated.
When an orderby is used, paging can be implemented by changing the where (filter) instead. Rows skipped because of a filter do not need to be fully calculated and result in much faster queries.

@hylkevds hylkevds added dependencies Pull requests that update a dependency file enhancement and removed dependencies Pull requests that update a dependency file labels Jan 14, 2022
@hylkevds
Copy link
Member Author

hylkevds commented Apr 4, 2022

The develop-2.0 branch now has this enhancement and it makes paging significantly faster.
Some limitations:

  • Only works if there is an orderBy on the primary key in the list of oderBys. This can be added automatically with the alwaysOrderbyId setting.
  • Only works for path ordering, not for ordering by function.

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

No branches or pull requests

1 participant