tobytwigger / laravel-job-status

The only Laravel job debugging tool you'll ever need
https://tobytwigger.github.io/laravel-job-status
MIT License
19 stars 1 forks source link

Eager load job information before starting #75

Closed tobytwigger closed 1 year ago

tobytwigger commented 1 year ago

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.

tobytwigger commented 1 year ago

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.