-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#5199] Optimize /project/children endpoint
# Counting children This was slow because we made a query for each project. Now we get the children and grand children. A simple dict with each project and a list of their children is then built in python. **Side effect** Paging doesn't work anymore as the queryset includes grand children. Reimplementing it can be done another time if we really do have projects with enormous hierarchies. # Parent retrieval We already know who the parent is since we're getting its children --> no need to make another query. # Locations We weren't retrieving related objects, which we now do. Additionally, we iterated over the list of countries twice when one iteration was enough.
- Loading branch information
1 parent
6d9db83
commit 3a92d56
Showing
3 changed files
with
66 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters