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
Good catch on that. I think you're correct that the current index is insufficient for the throttle query 😓
I think the correct index here would be [concurrency_key, :created_at]. That would also cover the execution throttling (as it can use just the first column of the compound index):
When the concurrency extension looks up for existing queued jobs within the throttle period, it performs the following query :
good_job/lib/good_job/active_job_extensions/concurrency.rb
Lines 93 to 95 in b557525
In my case, this query will run in 200-300ms for each enqueue attempt, so it adds up pretty quickly when trying to enqueue hundreds of jobs.
The index on
concurrency_key
has awhere finished_at is NULL
, so it can't be used here.Would it make sense to have an index solely on
concurrency_key
?Thanks
The text was updated successfully, but these errors were encountered: