Fix excess queries and audit code for the datagrids.

Review Request #13366 — Created Oct. 22, 2023 and submitted

Information

Review Board
release-5.0.x

Reviewers

The new query tests for the datagrids unveiled a number of excess
queries when working with Local Sites. We were querying one Local Site
per row when viewing any review request datagrid on a Local Site. This
was due to the lack of any select_related or equivalent.

This change fixes that, significantly reducing the overhead and the
removing the padded excess queries in the unit tests.

In the process, I've audited the code, cleaned up some calls to help
avoid potential problems down the road, and reduced additional queries
that involved Local Sites, helping keep queries simpler on a standard
setup.

Unit tests pass.

Tested all the datagrids, making sure there were no apparent regressions.

Summary ID
Fix excess queries and audit code for the datagrids.
The new query tests for the datagrids unveiled a number of excess queries when working with Local Sites. We were querying one Local Site per row when viewing any review request datagrid on a Local Site. This was due to the lack of any `select_related` or equivalent. This change fixes that, significantly reducing the overhead and the removing the padded excess queries in the unit tests. In the process, I've audited the code, cleaned up some calls to help avoid potential problems down the road, and reduced additional queries that involved Local Sites, helping keep queries simpler on a standard setup.
daa5ea4d9ce8b47a1989df62c91a7ea9e30d0446
Description From Last Updated

Could you add Args: and Returns: while you're here?

maubinmaubin
david
  1. Ship It!
  2. 
      
maubin
  1. 
      
  2. reviewboard/datagrids/grids.py (Diff revision 1)
     
     
    Show all issues

    Could you add Args: and Returns: while you're here?

  3. 
      
chipx86
david
  1. Ship It!
  2. 
      
maubin
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.0.x (f270e0f)