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 issues with sqlalchemy count() vs all() #16016

Open
martenson opened this issue Apr 28, 2023 · 0 comments
Open

pagination issues with sqlalchemy count() vs all() #16016

martenson opened this issue Apr 28, 2023 · 0 comments
Assignees
Labels
area/API area/database Galaxy's database or data access layer kind/bug

Comments

@martenson
Copy link
Member

Because of this sqlalchemy quirk our grids pagination has issues in some places e.g. on workflowlist. I am not sure yet what causes the duplication which query.all() removes but one of the effects is that page sizes are not consistent (i.e. you get 12 results for a limit of 15).

Relatedly the total_matches reported to the caller through headers is in my observation also inconsistent with reality.

in workflows case we return query.count()=X here but once query.all() is called the count is not guranteed

The initial and final statements look like this: https://gist.github.com/martenson/5beaf3fd4aa952db7c5ae8b285448471
The limit() is is applied in the inner select so I think (?) that should be where the duplication is present.

On my DB with limit 5 the second query has .count()=5 and .all() gives you 3 workflows.

@martenson martenson added kind/bug area/API area/database Galaxy's database or data access layer labels Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/API area/database Galaxy's database or data access layer kind/bug
Projects
None yet
Development

No branches or pull requests

2 participants