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

pagination performance on large datasets #963

Open
boicetomlin opened this issue Mar 30, 2021 · 2 comments
Open

pagination performance on large datasets #963

boicetomlin opened this issue Mar 30, 2021 · 2 comments

Comments

@boicetomlin
Copy link

boicetomlin commented Mar 30, 2021

On large datasets using SQL_CALC_FOUND_ROWS produces slow results. it would be nice to have a way to select a page of results and issue a separate query to get the number of found rows. ordering, joining in combination with SQL_CALC_FOUND_ROWS produces even slower results. I'm seeing much faster performance by issuing separate queries for the limited result set and then another for the count result. however the class does not appear to offer this ability out of the box. the get() method only allows me to limit the results not select a limit range and the paginate method uses SQL_CALC_FOUND_ROWS without an option to turn it off. I would love to work on a modification to this class that offered a few different methods of pagination that addressed performance issues on large datasets.

@syrian-dev
Copy link

i have same issue
pagination so slow with 700k records
do you find a solution ?

@boicetomlin
Copy link
Author

my solution was to first disable SQL_CALC_FOUND_ROWS. then do a query to select the data and another query with the same conditions to select the count.

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

3 participants