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

Enhance query performance using batch-loading #881

Merged
merged 6 commits into from
Aug 21, 2023

Conversation

pylipp
Copy link
Contributor

@pylipp pylipp commented Aug 3, 2023

Make more use of batch-loading for user, base, and organisation fields, hence avoiding excessive DB queries.

@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Merging #881 (d3e10c1) into master (623e845) will increase coverage by 0.11%.
Report is 11 commits behind head on master.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #881      +/-   ##
==========================================
+ Coverage   71.28%   71.39%   +0.11%     
==========================================
  Files         285      285              
  Lines        7246     7274      +28     
  Branches     1531     1519      -12     
==========================================
+ Hits         5165     5193      +28     
  Misses       2046     2046              
  Partials       35       35              
Flag Coverage Δ
backend 96.93% <100.00%> (+0.02%) ⬆️
frontend 51.72% <ø> (ø)

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

Files Changed Coverage Δ
back/boxtribute_server/graph_ql/execution.py 100.00% <ø> (ø)
...ribute_server/business_logic/beneficiary/fields.py 100.00% <100.00%> (ø)
...er/business_logic/box_transfer/agreement/fields.py 100.00% <100.00%> (ø)
...xtribute_server/business_logic/core/base/fields.py 100.00% <100.00%> (ø)
...ack/boxtribute_server/business_logic/tag/fields.py 100.00% <100.00%> (ø)
...ck/boxtribute_server/business_logic/user/fields.py 100.00% <100.00%> (ø)
..._server/business_logic/warehouse/product/fields.py 100.00% <100.00%> (ø)
..._server/business_logic/warehouse/qr_code/fields.py 100.00% <100.00%> (ø)
back/boxtribute_server/graph_ql/loaders.py 100.00% <100.00%> (ø)

Accessing `box.location.base_id` previously issued another DB select
query to fetch the location field albeit already joining with the
location table. Now the `Box.select()` call is updated
- reduce duplicated code
- sort classes in file
…egories

Would be fixed by updating the RBP names in the Auth0 scripts for dev
and staging; but that in turn after merging confusingly breaks all open
PRs as long as they are not rebased on master yet
Cf. https://trello.com/c/J34Z923v
@pylipp
Copy link
Contributor Author

pylipp commented Aug 18, 2023

@pylipp pylipp marked this pull request as ready for review August 18, 2023 07:48
Copy link
Member

@HaGuesto HaGuesto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code review

looks good

functional review

everything works as before. hard to test though

@pylipp pylipp merged commit 8c9b4da into master Aug 21, 2023
5 checks passed
@pylipp pylipp deleted the enhance-query-performance branch August 21, 2023 20:49
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