-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Improve dropAllForeignKeyConstraints performance #2155
Improve dropAllForeignKeyConstraints performance #2155
Conversation
Hi @Spindl Thanks for the issue and PR creation. We will add this to the list of issues and PRs that we are processing.
The PR will be prioritized according to our internal development and testing capacity. We’ll let you know when it’s ready to move to the next step or if any changes are needed. |
…erformance_improvement
Hi @Spindl - so from what I see this fall under the "bug fix" section right? Control was create but wasn't used.
Also there is test coverage on DropAllForeignKeyConstraintsChangeTest . Thanks! |
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.
Simple fix that improves performance as shown in my previous comment. Also there are test covering it.
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.
This PR fixes a Postgres performance bug during foreign key drops. The fix sets a snapshotControl
objects to ensure the entire schema metadata is not scanned to find matching foreign keys.
- No additional testing required.
APPROVED
Impact
Description
The dropAllForeignKeyConstraints change performs poorly for bigger database schemas in PostgreSQL databases, because more or less the complete schema metadata is loaded for finding the names of the foreign key constraints of a single table. Control was create but wasn't used.
Fixes #2154
Fixes #1571
Things to be aware of
Things to worry about