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

Remove foreign key contraint in table job_warnings on 'fk_jobs_id' #4174

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

svkrieger
Copy link
Contributor

  • A short explanation of the proposed change:

Deletion of foreign key constraint in job_warnings table on fk_jobs_id. This also deletes the column fk_jobs_id.
This will drastically increase the speed of the cleanup job of the pollable jobs table.

  • An explanation of the use cases your change solves

The job_warnings table was created in a wrong way. There are two columns 'job_id' and 'fk_jobs_id'. There is a foreign key constraint on 'fk_jobs_id', which references jobs(id). CC coding never inserts data into 'fk_jobs_id', but only into 'job_id'. So the foreign key constraint is not needed but causes way slower cleanup of pollable jobs, which can even run into DB statement timeouts and cause an ever growing table. CC already takes care of deleting job_warnings when jobs are deleted.

  • Links to any other associated PRs

  • 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

The job_warnings table was created in a wrong way. There are two columns 'job_id' and 'fk_jobs_id'.
There is a foreign key constraint on 'fk_jobs_id', which references jobs(id).
CC coding never inserts data into 'fk_jobs_id', but only into 'job_id'.
So the foreign key constraint is not needed and causes way slower cleanup of pollable jobs,
which can even run into DB statement timeouts and cause an ever growing table.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant