rubyforgood / casa

Volunteer management system for nonprofit CASA, which serves foster youth in counties across America.
https://casavolunteertracking.org/
MIT License
316 stars 479 forks source link

fix SupervisorsController#datatable N+1 issues #5891

Closed elasticspoon closed 3 months ago

elasticspoon commented 4 months ago

What type(s) of user does this feature affect?

Description

This controller action has issues with N+1 queries (method call makes an additional method call for each item it finds.)

You can see these in our scout: https://scoutapm.com/shares/cd70c473-d304-4df7-84e1-1b7c519aa4e9

Go through all the methods to ensure all the needed data is preloaded in the first query and no additional calls to the database need to be made.

N+1 Resources

How to access the QA site

Login Details:
Link to QA site

Login Emails:

password for all users: 12345678

Questions? Join Slack!

We highly recommend that you join us in slack #casa channel to ask questions quickly. And discord for office hours (currently Tuesday 5-7pm Pacific), stakeholder news, and upcoming new issues.

guswhitten commented 3 months ago

@elasticspoon I can take this one.