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

fix: use count() when sized_sliceable is a queryset #38

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

superlevure
Copy link
Collaborator

@superlevure superlevure commented Oct 17, 2023

When sized_sliceable is a QuerySet and we need to know its len we should use sized_sliceable.count() which triggers a SELECT COUNT(*) query instead of fetching all the DB objects in Python with len(sized_sliceable)

@tcleonard tcleonard self-requested a review October 17, 2023 13:20
@superlevure superlevure merged commit c63bf2a into loft-main Oct 17, 2023
@lucas-bremond lucas-bremond deleted the fix/relay-count branch October 17, 2023 15:14
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

Successfully merging this pull request may close these issues.

2 participants