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

Paging query calculates count with each page (Requires breaking change) #230

Open
FransBouma opened this issue Mar 13, 2015 · 0 comments
Open

Comments

@FransBouma
Copy link
Owner

Currently a paging query also calculates the total # of rows. This means the query is actually executed twice: once for obtaining the resultset page, and once for calculating the # of rows.

Paging through a resultset therefore is slower than needed, as the count isn't always needed on subsequential pages. It might (some people like to think they're not working with stale data) but in general it's common the # of rows is calculated once, the # of pages is calculated from that and paging through the resultset based on that number is then done by just calculating the rows on page P. It's uncommon users page through all the pages in a resultset (unless there are a low number of pages).

If the query executed is an expensive query, executing it multiple times for no reason can hurt performance, so it should be possible to specify whether the # of rows should be calculated as well or not.

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

1 participant