• 
      

    Eliminate JOINs when determining LocalSite user membership.

    Review Request #12351 — Created June 10, 2022 and submitted

    Information

    Review Board
    release-5.0.x

    Reviewers

    This updates the new User.get_local_site_stats() method to avoid
    having to perform JOINs between a User and a LocalSite by way of
    users or admins. We now use the through tables 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.

    Summary ID
    Eliminate JOINs when determining LocalSite user membership.
    This updates the new `User.get_local_site_stats()` method to avoid having to perform JOINs between a `User` and a `LocalSite` by way of `users` or `admins`. We now use the `through` tables 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.
    b55ffb4bb91f7750ac587b89a46a41cafc3de1aa
    chipx86
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-5.0.x (0ef1b9c)