Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove pre-fetching for grant associations
When finding grants, we were loading associations for some general convenience. However, we do not inspect the grants in detail for our current use cases -- we supply very specific join/where conditions and check for their existence as the implementation of the authorization rules. This preloading would be useful for building an administrative interface, for example, but is unncessary now. The reason to remove it is to avoid complexity and a performance problem introduced by fetching the institution memberships: we were loading all of them for any matched institution and doing an in-memory join on the object graph. In production, that can be a giant list, consuming excessive time and memory. This problem can be solved by "adjusting the combine", applying appropriate pieces of the filter conditions the association nodes, but it is not worth doing now. We would be doing extra work and extra queries to throw the data away.
- Loading branch information