readthedocs.org
e61d7a65 - Search: optimize queryset when searching for subprojects (#12588)

Commit
19 days ago
Search: optimize queryset when searching for subprojects (#12588) With 3 subprojects: from 20 queries (with 4 extra queries per additional subproject) to 11 (with 1 query per extra subproject). In .com we have a customer with 80 subprojects, that's generating +320 queries per search :_ Main optimizations: - get_canonical_custom_domain was changed to be a cached property, so it can be re-used for each superproject (shared instance) on each subproject. - Instead of using `Project.objects.filter(superprojects__parent...)`, we just use `project.subprojects`, so it's easier to cache the relationship into `_superprojects`, which is then used by Project.parent_relationship.
Author
Parents
Loading