Open nkorobkov opened 4 years ago
Problem Some pages load very slow I suspect that code has places where unnecessary joins are executed during page rendering.
What to do Look through the code and find all suspicious places. Fix all problems with Django object annotations https://docs.djangoproject.com/en/2.2/topics/db/aggregation/
Also: https://medium.com/@hansonkd/the-dramatic-benefits-of-django-subqueries-and-annotations-4195e0dafb16
Criteria There are no DB queries in a loop and no extra joins in the code.
https://docs.djangoproject.com/en/3.0/ref/models/querysets/#django.db.models.query.QuerySet.select_related
Problem Some pages load very slow I suspect that code has places where unnecessary joins are executed during page rendering.
What to do Look through the code and find all suspicious places. Fix all problems with Django object annotations https://docs.djangoproject.com/en/2.2/topics/db/aggregation/
Also: https://medium.com/@hansonkd/the-dramatic-benefits-of-django-subqueries-and-annotations-4195e0dafb16
Criteria There are no DB queries in a loop and no extra joins in the code.