About MySQL Build table recommendations, query involves more than 10 fields, is a table or a multi-table union or build a view

Source: Internet
Author: User
I have a topic table, including content title author and other information, accompanied by a Topic_extra contains the number of replies, likes, satisfaction reply, update and other information. A total of 14 fields, each table after the split is only six or seven, I think the table can be small, small bar.

The contradiction is that when the query needs to be federated, plus the user table, and other permissions control may be 4 tables join together, but write most of the Topic_extra. I wonder if I can solve this contradiction through the view, or what do we usually do, why?

Reply content:

I have a topic table, including content title author and other information, accompanied by a Topic_extra contains the number of replies, likes, satisfaction reply, update and other information. A total of 14 fields, each table after the split is only six or seven, I think the table can be small, small bar.

The contradiction is that when the query needs to be federated, plus the user table, and other permissions control may be 4 tables join together, but write most of the Topic_extra. I wonder if I can solve this contradiction through the view, or what do we usually do, why?

4 table do join a bit more, if it is I may not do a join, because the requirements are different, the data to be extracted is also different, can be associated with the ID extra field to fetch data, combined with the cache, high performance will be OK

  • 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.