Reduce profile queries in the datagrids.

Review Request #8875 — Created April 5, 2017 and submitted

Information

Review Board
release-3.0.x
4606180...

Reviewers

The introduction of avatar support caused performance degradations in
the datagrids due to the way profiles are fetched. Every entry had a
get_profile() call, which performed a database lookup, which made the
dashboard and other datagrids very slow.

To solve this, the columns now do a select_related() on the profile
field, and get_profile() has been updated to reuse the same caching
variable that's populated for the relation. This means that if a profile
is ever included using select_related() or looked up using the field
relation, we can call get_profile() without performing an additional
lookup.

Verified that the dashboard, All Review Requests, and user pages no
longer have a profile query per datagrid entry.

Unit tests pass.

Description From Last Updated

Typo in description: "very slo"

daviddavid
david
  1. 
      
  2. Typo in description: "very slo"

    1. The 'w' was coming in. Just wasn't there yet. It was that slow.

  3. 
      
chipx86
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (4a9dc80)
Loading...