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

finished_at should be indexed and clean up should clean up all of a job's executions #476

Closed
zarqman opened this issue Jan 1, 2022 · 1 comment · Fixed by #477
Closed

Comments

@zarqman
Copy link
Contributor

zarqman commented Jan 1, 2022

Thanks for adding the new option to automatically cleanup preserved jobs!

I noticed that GoodJob::Execution.finished(timestamp).delete_all inside of cleanup_preserved_jobs is querying finished_at but that column isn't indexed resulting in a table scan. I'm thinking finished_at needs an index (possibly conditional on being not null)?

@bensheldon
Copy link
Owner

@zarqman thank you! 🙏

I'll add an index. That also caused me to notice that the cleanup task should retain Execution records until the Job itself completes successfully, then cleanup all the Job's executions at once.

@bensheldon bensheldon changed the title finished_at should be indexed finished_at should be indexed and clean up should clean up all of a job's executions Jan 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants