-
Notifications
You must be signed in to change notification settings - Fork 0
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 consecutive db queries #1364
Conversation
Does this load them more efficiently? |
@longhotsummer Yes. |
@longhotsummer I'm checking the code and I can't find where its actually doing a recursive call. But checking query count shows that using |
@longhotsummer another tricky bit is this here:
Calling |
529cf98
to
299e55a
Compare
299e55a
to
54f993c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, let's see what the impact is
@longhotsummer Looking through Sentry docs on consecutive db queries, it says they are caused by several db queries that are called in sequence which may not necessarily be related. Sentry says that they can be called in parallel to save on time. I think this happens because some queries trigger in the context_processor (loading settings), some happen in the view layer and some can happen in the template. I'm not sure how to fix some of them. Sentry is also flagging many slow queries especially on the judgment listings. The recommended solutions are caching the data and adding more indexed columns. I haven't done that here but I'll keep investigating. |
fixes #1347