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

RES 1842 reduce N+1 queries #619

Merged
merged 3 commits into from Feb 20, 2023
Merged

RES 1842 reduce N+1 queries #619

merged 3 commits into from Feb 20, 2023

Conversation

edwh
Copy link
Collaborator

@edwh edwh commented Feb 13, 2023

These are now usefully spotted by Sentry. Add some uses of with() and caching to reduce database queries.

# Conflicts:
#	app/Http/Controllers/PartyController.php
@sonarcloud
Copy link

sonarcloud bot commented Feb 20, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@ngm ngm left a comment

Choose a reason for hiding this comment

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

So it looks like everywhere(?) that we query on groups, we now also eagerly fetch the info about networks in. To avoid that query on the networks running for every group, each time we iterate through a list of groups.

Seems good, I suppose we might to think about it if for example networks themselves ever started eagerly fetching things as well, I guess you can get to a point where you end up pulling the whole DB if you're not careful.

Nice to cache the roles table as well.

@edwh edwh merged commit d259b18 into develop Feb 20, 2023
3 checks passed
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.

None yet

2 participants