Optimize querying with private review requests.
Review Request #5669 — Created April 2, 2014 and submitted — Latest diff uploaded
When querying lists of review requests that contained private review
requests, the query ended up joining enough tables where the query could
take a substantial amount of time to execute.This change optimizes the query by pulling out a couple of the more
expensive joins into a couple simple queries. The result is a much
faster query.
All unit tests passed.
Ran some sample queries on reviews.reviewboard.org, and saw the speed
differences.