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

resolve degenerate n+1 query in manage.project.releases #17563

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

ewdurbin
Copy link
Member

@ewdurbin ewdurbin commented Feb 5, 2025

adds helpers for getting all active/yanked releases in one shot, uses that in favor of selectattr/rejectattr in the templates

for worst case I could find in dev db (cs18-sidecar):

Before:

Screenshot 2025-02-05 at 11 16 16 AM

After:

Screenshot 2025-02-05 at 11 11 05 AM

adds helpers for getting all active/yanked releases in one shot, uses that in favor of selectattr/rejectattr in the templates
@ewdurbin ewdurbin requested a review from a team as a code owner February 5, 2025 16:16
@ewdurbin
Copy link
Member Author

ewdurbin commented Feb 5, 2025

FWIW, there is something... off about the way selectattr and rejectattr seem to interact with the ORM...

The N+1 queries kicked off by use of those jinja filters lead to queries of this type:

Screenshot 2025-02-05 at 9 57 13 AM

@ewdurbin ewdurbin merged commit 2337ab4 into main Feb 5, 2025
20 checks passed
@ewdurbin ewdurbin deleted the manage_releases_n_query branch February 5, 2025 20:23
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