Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change delayed_jobs_reserve index #3650

Conversation

philippthun
Copy link
Member

@philippthun philippthun commented Feb 22, 2024

Add WHERE condition. Jobs that failed are only kept for debugging purposes, they are not taken into account when reserving a job. The corresponding SELECT statement [1] includes WHERE failed_at IS NULL, so the corresponding index can omit failed jobs.

Partial indexes are not supported for MySQL, thus this change is only for PostgreSQL.

[1] https://github.com/TalentBox/delayed_job_sequel/blob/938ff68e98b44bbc391805c672a74c5ee3aef08b/lib/delayed/backend/sequel.rb#L26

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

Add WHERE condition. Jobs that failed are only kept for debugging
purposes, they are not taken into account when reserving a job. The
corresponding SELECT statement [1] includes 'WHERE failed_at IS NULL',
so the corresponding index can omit failed jobs.

Partial indexes are not supported for MySQL, thus this change is only
for PostgreSQL.

[1] https://github.com/TalentBox/delayed_job_sequel/
      blob/938ff68e98b44bbc391805c672a74c5ee3aef08b/
      lib/delayed/backend/sequel.rb#L26
@philippthun philippthun force-pushed the change-delayed-jobs-reserve-index branch from 9cb7987 to 1077bae Compare February 22, 2024 12:44
@philippthun philippthun marked this pull request as ready for review February 22, 2024 13:03
@philippthun philippthun merged commit 4ac994f into cloudfoundry:main Feb 26, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants