We had the n+1 problem in several places when converting a job to an array to show on the dashboard. Through eagerloading, we've changed this to 8 per query.
I've put the eagerloading into the model directly, so that users will benefit from it without needing to do anything special.
This PR relates to #63, but doesn't fix it. The queries are still taking a while (up to 80ms), and it's taking a very long time to group and sort the runs into themselves, batches, jobs and queues.
We had the n+1 problem in several places when converting a job to an array to show on the dashboard. Through eagerloading, we've changed this to 8 per query.
I've put the eagerloading into the model directly, so that users will benefit from it without needing to do anything special.