Dramatically improve dashboard query performance with relation columns.

Review Request #6490 — Created Oct. 22, 2014 and submitted

Information

Review Board
release-2.0.x
39cf866...

Reviewers

The "Target People", "Target Groups", and "To Me" columns each added one query
per row. This change adds some smarts to the database accesses. The "To Me"
column now caches all of the directly-assigned review requests into a list
which is stored in the datagrid state. The target people and target groups
columns now do a prefetch_related() to have only one additional query for the
column, rather than one per row.

  • Loaded the dashboard with all of these columns enabled. Before this change,
    for my particular set of review requests, it ran 29 queries in 25ms. After
    this change, the same dashboard ran with 11 queries in 12ms.
  • Ran unit tests.
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/datagrids/columns.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/datagrids/columns.py
    
    
  2. 
      
chipx86
  1. Ship It!

  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.0.x (ce1e3b7)
Loading...