Why use less foreign keys? What are the main differences between foreign keys and table links?

Source: Internet
Author: User
How do you choose the usual
Between the outer key and the table link

Reply content:

How do you choose the usual
Between the outer key and the table link

Look at the situation, for example, you have a table to store product data, another table for the product type, this time with foreign keys and nothing
If you have a table that holds order data, another table that stores customer information, a table that stores product information, and a table that stores information about the store, then the foreign key will be slow
I do not understand ha, look at the bottom, if necessary to translate for you
Http://stackoverflow.com/questions/83147/whats-wrong-with-foreign-keys

When you want to delete a large table data, you know, various restrictions, of course, if your model is well designed, these can also be avoided
I am now in charge of two maintenance projects, in addition to the configuration table, rarely using foreign keys to correlate what

When I was practicing at Microsoft, a colleague wrote a foreign key that caused a lot of problems. Then I mentor said: "Do not add foreign keys, in my opinion, the foreign key is used for drawing." ”

No foreign keys are prone to dirty data.
Can't unworthy.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.