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
Using Django Debug Toolbar I noticed that the NotificationViewList that displays the list of all notifications loads Django ORM very much and creates a lot of queries to the database.
How can this be optimized? I think it's possible using get_queryset(), but I don't know exactly which object will be displayed in this list and there is no clean way to extend the view, so I can't make select_related() for all situations. Most likely it needs to be executed for GenericForeignKey.
Using Django Debug Toolbar I noticed that the
NotificationViewList
that displays the list of all notifications loads Django ORM very much and creates a lot of queries to the database.How can this be optimized? I think it's possible using
get_queryset()
, but I don't know exactly which object will be displayed in this list and there is no clean way to extend the view, so I can't makeselect_related()
for all situations. Most likely it needs to be executed forGenericForeignKey
.Here is my template override file
How can I reduce the load on the database and reduce queries?
The text was updated successfully, but these errors were encountered: