-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Optimize database foreign keys references - PostgreSQL #13550
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
Conversation
…gn key references
|
Fix for mysql is already added on #12843. I think the issue doesn't exist for sqlite as the query already looks optimized |
Codecov Report
@@ Coverage Diff @@
## master #13550 +/- ##
=======================================
Coverage 54.25% 54.25%
=======================================
Files 1199 1198 -1
Lines 30600 30598 -2
Branches 5571 5571
=======================================
Hits 16601 16601
+ Misses 12181 12179 -2
Partials 1818 1818
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
Performance improvement here is not as good as #12843 but PG as already a bit faster than MySQL anyway
This could just be differences between the two databases in general or how we are handling other parts of the schema inspector. Regardless it's still an improvement. Tests were also performed on a very small application so some larger apps may see much better gains. Patch files based on v4.2.0 |
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.
Much like the MySQL PR it looks good to me but we do need @alexandrebodin to take a look here. Automated tests already passed fine so good there.
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.
LGTM. Thank you for those contributions 👍
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.
Great work @meherchandan
|
This pull request has been mentioned on Strapi Community Forum. There might be relevant details there: |
…gn key references
What does it do?
Describe the technical changes you did.
Optimize the "getForeignKeys" when synchronizing with the database for postgres db.
Why is it needed?
Describe the issue you are solving.
On existing database, knex timeout error is coming when adding a new component. The PR is simplifying the complex(costly) database queries to remove the timeout error.
How to test it?
Provide information about the environment and the path to verify the behaviour.
Related issue(s)/PR(s)
Let us know if this is related to any issue/pull request
#11860