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

GetPaged selects all records for count #259

Open
jonvandermey opened this issue Mar 18, 2011 · 1 comment
Open

GetPaged selects all records for count #259

jonvandermey opened this issue Mar 18, 2011 · 1 comment

Comments

@jonvandermey
Copy link

[ModelName].GetPaged() produces two queries. The first selects all records just to iterate over them for a count, and the second to select the records according to the paging parameters.

With tens of thousands of records, it causes the fetching of 10 records to take a long time. I've narrowed it down to line 134 of the SubSonicRepository.cs file.
https://github.com/subsonic/SubSonic-3.0/blob/master/SubSonic.Core/Repository/SubSonicRepository.cs#L135

When the commented out code is used instead, the first query is a simple count query rather than than fetching every record.

@saintedlama
Copy link
Collaborator

Thank you for pointing out that issue, the implementation looks really weird - I'll fix that in the next days

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

2 participants