You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the notices() view does not retrieve notice types together with notices for current user. If the template processes each notice like below:
{% for notice in notices %}
{{ notice.notice_type.display }}
{% endfor %}
each notice_type is fetched separately from the database. When the user is displayed a lot of notifications, query count will quickly increase. I propose a patch to optimize away most of these queries by using select_related() in the view function.
Currently the notices() view does not retrieve notice types together with notices for current user. If the template processes each notice like below:
each notice_type is fetched separately from the database. When the user is displayed a lot of notifications, query count will quickly increase. I propose a patch to optimize away most of these queries by using select_related() in the view function.
Patch: http://gist.github.com/429952
The text was updated successfully, but these errors were encountered: