-
Notifications
You must be signed in to change notification settings - Fork 905
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
Add foreign keys to the Mysql-scheme #1896
Conversation
We need to make sure there are no performance/locking implications. |
From what I see on a search on 'mysql foreign key performance implications', UPDATES/INSERTS (as I would expect) might suffer from a foreign key. For SELECTS, it looks like people are saying that foreign keys actually improve performance because of the indexes it needs. Foreign keys AFAIK only kick in on updates and inserts, to check if the foreign key matches. For selects, the foreign key is ignored. http://books.google.nl/books?id=IagfgRiKWd4C&lpg=PA282&ots=wZa7nYWtzh&dq=mysql%20foreign%20key%20performance%20implications&hl=nl&pg=PA281#v=onepage&q=mysql%20foreign%20key%20performance%20implications&f=false |
I am happy to merge this right now if it is made optional. Alternatively I will entertain serious benchmark numbers :) |
I'll happily benchmark stuff. Just let me know what you want benchmarked. :) |
Some things I care about in this context:
|
744acba
to
e446770
Compare
PR Updated to only add a file which you can optionally use to enable foreign keys |
Would be nice if you could include the file in test suite, though. |
Not sure about that - would make the test suite deviate from common production setups |
On the other paw this does make the tests more stringent and does not enable anything new |
True. No objections. Please help @tuxis-ie out, he doesn't know where to put it! |
If you add some docs we can merge this, with or without tests. |
Add foreign keys to the Mysql-scheme
Also, add a .sql file that will create the foreign keys on existing databases. But only AFTER the 3.x_to_3.4.0-scripts are run.