You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been looking into slow performance of the dashboard in production and I want to share my findings in case you didn't know about the bottlenecks that we're seeing or you can spot some low hanging fruits.
Here's a typical trace of a request to /good_job/jobs:
It's about a 20s load time where all the time is spent on database queries. The most expensive is
As I understand that, the sequential scan is the culprit and I believe the scan is because of COALESCE(good_jobs.scheduled_at, good_jobs.created_at). On my system only schedule_at is indexed and not created_at. Shouldn't created_at be indexed as well?
The text was updated successfully, but these errors were encountered:
Oof! That's slow. I think this is easier now with GoodJob v4:
The pg_locks could be replaced with a locked_at IS NOT NULL query
The COALESCE can be replaced solely with good_jobs.scheduled_at because now all jobs should have a scheduled_at regardless of whether they are expect to run immediately or in the future.
Would you want to try making a PR? Otherwise I can get to it ;-)
Hi @bensheldon 😄
I've been looking into slow performance of the dashboard in production and I want to share my findings in case you didn't know about the bottlenecks that we're seeing or you can spot some low hanging fruits.
Here's a typical trace of a request to
/good_job/jobs
:It's about a 20s load time where all the time is spent on database queries. The most expensive is
An
explain
of that yields this result:Which visualises as
As I understand that, the sequential scan is the culprit and I believe the scan is because of
COALESCE(good_jobs.scheduled_at, good_jobs.created_at)
. On my system onlyschedule_at
is indexed and notcreated_at
. Shouldn'tcreated_at
be indexed as well?The text was updated successfully, but these errors were encountered: