Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Query optimization for the Briefcase viewset (#2142)
* Calculate instance_count only when the `instances` queryset is a slice Avoid multiple calls to `.count()` which case the application to re-query the database * Retrieve the `pk` & `uuid` fields only Minor optimization for the `SELECT` query as we do not utilize any of the other columns within the instance table in the BriefcaseViewSet * Retrieve instance_count by retrieving the length of the `instances` queryset Not using the `num_of_submissions` attribute since it counts submissions which have not yet received all media files yet. * Update comment * Remove trailing whitespace * Check if `instance_count` is greater than 0
- Loading branch information