Why do we need to use less foreign keys? What are the main differences between foreign keys and table links?

Source: Internet
Author: User
How do you choose what you usually choose between the foreign key and the table link?
Between Foreign key and table Link

Reply content:

How do you choose
Between Foreign key and table Link

Let's see the scenario. For example, if you have a table to store product data and another table to store the product type, there is no foreign key at this time.
If you have a table that stores order data, another table that stores customer information, a table that stores product information, and a table that stores store information, it will be slow to use a foreign key.
I don't know much about it either. Let's take a look at it. If you need it, translate it for you.
Http://stackoverflow.com/questions/83147/whats-wrong-with-foreign-keys

When you want to delete data from a large table, you will understand the various restrictions. Of course, if your model is well designed, these can also be avoided.
In the two maintenance projects I am currently responsible for, except for configuration tables, I seldom use foreign keys to associate

Some colleagues wrote Foreign keys during my internship at Microsoft, which caused many problems. Then I mentor said, "Do not add Foreign keys. In my opinion, foreign keys are used for plotting ."

Dirty data is easy to appear without foreign keys.
You cannot discard food for any reason.

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.