-
Notifications
You must be signed in to change notification settings - Fork 557
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update get_users_with_perms to avoid a large join
This code was creating a large number of table joins "Users that are part of a group that have perms to obj" requires that we join 5 tables: user - m2m - group - m2m - obj Instead; we perform an intermediate query to fetch all of the groups that have a perm record to the object (a join across 3 tables), and then we fetch all of the users that belong to one of those groups (a join across 3 tables).
- Loading branch information
1 parent
cea980c
commit b5de761
Showing
1 changed file
with
10 additions
and
10 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