-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix fetch job performance regression #1225
Conversation
Coverage reportClick to see where and how coverage changed
The report is truncated to 25 files out of 28. To see the full report, please visit the workflow summary page. This report was generated by python-coverage-comment-action |
382665b
to
c815369
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems awesome. Let's not forget to port this to v3.
Thank you for your quick reaction!
@@ -0,0 +1,7 @@ | |||
-- recreate procrastinate_jobs_id_lock_idx index by adding aborting status to the filter so that it can be used by the fetch job function | |||
CREATE INDEX procrastinate_jobs_id_lock_idx_temp ON procrastinate_jobs (id, lock) WHERE status = ANY (ARRAY['todo'::procrastinate_job_status, 'doing'::procrastinate_job_status, 'aborting'::procrastinate_job_status]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for self, don't forget to tell people in the release notes to create the index concurrently if applicable.
Released, and added some migration notes: |
This modifies indexes to improve performance of the
fetch_job
function.Recently added features such as job priority and aborting jobs have introduced a performance regression.
It fixes that performance regression by updating an existing index and adding a new one so that the
fetch_job
function avoids sequential scans of the job table in both the outer and inner query.It also contains an additional timing tweak to an acceptance test to make it less flaky
Successful PR Checklist:
PR label(s):