Update Profile to avoid LocalSite queries if LocalSites aren't used.

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

Information

Review Board
release-5.0.x

Reviewers

This updates Profile.get_starred_review_groups_count(),
Profile.get_starred_review_requests_count(), and related functions to
avoid factoring in a LocalSite value if Local Sites aren't used in the
deployment.

Most deployments do not use Local Site functionality. By performing this
check, we're able to avoid a JOIN between LocalSite and a starred
object, instead letting us operate on the through tables, just like
when LocalSite.ALL is passed. The vast majority of deployments will
benefit from this improved performance, especially combined with the new
caching.

All unit tests pass.

Summary ID
Update Profile to avoid LocalSite queries if LocalSites aren't used.
This updates `Profile.get_starred_review_groups_count()`, `Profile.get_starred_review_requests_count()`, and related functions to avoid factoring in a `LocalSite` value if Local Sites aren't used in the deployment. Most deployments do not use Local Site functionality. By performing this check, we're able to avoid a JOIN between `LocalSite` and a starred object, instead letting us operate on the `through` tables, just like when `LocalSite.ALL` is passed. The vast majority of deployments will benefit from this improved performance, especially combined with the new caching.
d7e07af12b0d49522c6c4fbe0d9f1b06baf0bdeb
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-5.0.x (3db1bc3)
Loading...