Eliminate JOINs when determining LocalSite user membership.
Review Request #12351 — Created June 10, 2022 and submitted
This updates the new
User.get_local_site_stats()method to avoid
having to perform JOINs between a
LocalSiteby way of
admins. We now use the
throughtables instead to build
the query. This simplifies the queries and allows the database to more
easily make use of the indexes established on these tables.
Unit tests pass.
assertQueries()when just comparing against the model's default table.
Revision 2 (+118 -326)
Checks run (2 succeeded)