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: optimize n+1 query when creating upload #377

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

giovanni-guidini
Copy link
Contributor

We noticed that we query the flags from an upload inside the loop
and decided to move that to the outside to reduce hits to the database

@trent-codecov trent-codecov linked an issue Feb 6, 2024 that may be closed by this pull request
@codecov-staging
Copy link

codecov-staging bot commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@codecov-qa
Copy link

codecov-qa bot commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2f854a0) 96.06% compared to head (179e816) 96.07%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #377   +/-   ##
=======================================
  Coverage   96.06%   96.07%           
=======================================
  Files         634      634           
  Lines       16538    16545    +7     
=======================================
+ Hits        15888    15895    +7     
  Misses        650      650           
Flag Coverage Δ
unit 96.07% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 96.07% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

codecov-public-qa bot commented Feb 6, 2024

Codecov Report

Merging #377 (179e816) into main (2f854a0) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #377   +/-   ##
=======================================
  Coverage   96.06%   96.07%           
=======================================
  Files         634      634           
  Lines       16538    16545    +7     
=======================================
+ Hits        15888    15895    +7     
  Misses        650      650           
Flag Coverage Δ
unit 96.07% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 96.07% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
upload/serializers.py 100.00% <100.00%> (ø)

Impacted file tree graph

We noticed that we query the flags from an upload inside the loop
and decided to move that to the outside to reduce hits to the database
@giovanni-guidini giovanni-guidini merged commit 2c21d4d into main Feb 6, 2024
21 checks passed
@giovanni-guidini giovanni-guidini deleted the gio/optimize-query branch February 6, 2024 18:43
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.

Fix N+1 Query on flag load
2 participants