-
Notifications
You must be signed in to change notification settings - Fork 14
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
Reduce number of queries to preferences db table #1082
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1082 +/- ##
==========================================
- Coverage 81.19% 81.18% -0.02%
==========================================
Files 140 140
Lines 5074 5076 +2
==========================================
+ Hits 4120 4121 +1
- Misses 954 955 +1 ☔ View full report in Codecov by Sentry. |
Quality Gate passedIssues Measures |
Prior to #1072 and this PR, a single request to
incidents/
lead to 21 (!) queries to theargus_auth_preferences
table 😄. This PR reduces this number by 7 (#1072 takes care of another 12) so that in the end we have only have 2 queries leftpage_size
preferenceWe could try and limit that further, but I don't think that that's worth the effort. One thing I'm thinking of, is a middleware that grabs all preferences and adds them to the Request, so that views, utils, context processors and others can just read them from there.
Other views also benefit from these PRs, but I don't have numbers for them