Table Structure Design (breaking a large table into multiple small tables)

Source: Internet
Author: User

If the data in a table is very large and the data in the table has multiple statuses, the query will be very slow.

What should we do?

First, you need a summary table, which stores the IDs of all data. Other data is saved into N tables according to N states.

In this way, you only need to query a certain type of data in the corresponding table. In this case, the query results will be very fast.

However, this approach will also lead to a drawback when you need to query all the data, because the multi-Table relationship is required, it will be very slow.

This method is not suitable when you need to query all the data frequently. However, this method is correct when only the category is queried.

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.