Eliminate JOINs when counting starred objects using LocalSite.ALL.
Review Request #12349 — Created June 9, 2022 and submitted
This improves performance of starred review group and review request
counting when using
LocalSite.ALL. Since we don't need to filter by
Profilestate in this case, we can simplify things by querying the
throughtable the starred items, filtering by the
This is much faster, as we don't need to JOIN any tables and the
database can more easily leverage the existing indexes.
Upcoming changes to use
us to short-cut the queries further in the common case of no Local
Sites, avoiding the JOINs on the majority of servers.
Unit tests pass.
assertQueries()when just comparing against the model's default table.
Revision 2 (+72 -190)
Checks run (2 succeeded)