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 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

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.
5caea929639bebfdb73a86c8b9cdfa4830b794b8 Christian Hammond
reviewboard/datagrids/tests.py
reviewboard/reviews/managers.py
reviewboard/reviews/tests/test_review_manager.py
reviewboard/site/managers.py
Loading...