Update review queries to query Local Sites conditionally.

Review Request #13357 — Created Oct. 18, 2023 and submitted — Latest diff uploaded

Information

Review Board
release-5.0.x

Reviewers

Review Board 5 introduced some mechanisms for optimizing queries to
avoid filering by Local Sites if there aren't any Local Sites in the
database. We updated a few queries to use this, but not all.

This change updates ReviewManager to take advantage of this, reducing
the complexity of queries and helping the database better use its
indexes on a typical install.

There's also a fix for building queries for Local Sites, taking
advantage of the field name provided.

This is the first in a series of changes for optimizing Local Site
filters out of queries.

All unit tests pass.

Diff Revision 2 (Latest)

orig
1
2

Commits

First Last Summary ID Author
Update review queries to query Local Sites conditionally.
Review Board 5 introduced some mechanisms for optimizing queries to avoid filering by Local Sites if there aren't any Local Sites in the database. We updated a few queries to use this, but not all. This change updates `ReviewManager` to take advantage of this, reducing the complexity of queries and helping the database better use its indexes on a typical install. There's also a fix for building queries for Local Sites, taking advantage of the field name provided. This is the first in a series of changes for optimizing Local Site filters out of queries.
c6f57ceec9b7747c264759ee3f0fac8e41932259 Christian Hammond
reviewboard/datagrids/tests.py
reviewboard/reviews/managers.py
reviewboard/reviews/tests/test_review_manager.py
reviewboard/site/managers.py
Loading...