-
Notifications
You must be signed in to change notification settings - Fork 841
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
Performance Issues with parallel FOREIGN KEYS ... ON DELETE CASCADE #8220
Comments
This is on an old version of Concourse (6.3.0). Should compare results on v7.0+ Which version of Postgres are you on? That may also be helpful, though I'm not sure how much performance would change between versions of postgres. |
concourse is version: v7.8.2 now. |
Summary
DELETE FROM pipelines WHERE id = 1; runs for hours due to too many FOREIGN KEYS ... ON DELETE CASCADE in the Database, some of them are references between the same Tables.
Steps to reproduce
create 1500 builds
explain analyze DELETE FROM pipelines WHERE id = 1;
Expected results
Much faster Execution
Actual results
even after the pipeline_id was deleted from builds, the FK Trigger takes 3.3 seconds of 3.4 total Execution Time:
QUERY PLAN | Trigger for constraint successful_build_outputs_rerun_of_fkey on builds: time=3299.810 calls=1
Additional context
work around:
psql -c " select 'delete from builds where id='||id||';' from builds where pipeline_id in (select id from pipelines where name like 'old%');" concourse -At | psql concourse
PS
trigger based dynamic DDL as in on_pipeline_insert and on_pipeline_delete is a source of performance issues, too.
Triaging info
The text was updated successfully, but these errors were encountered: