I currently have four tables for data operation problems. I need to display some of the fields in the table on the page. I don't want to use leftjoin now. I want to divide it into four SQL statements for query, then combine, but this will cause a problem: Search for several fields in four tables, or sort and pagination the fields. these operations will make my cooking more complicated, how can I optimize these operations? there are other solutions, such as le data operation problems?
Currently, I have four tables and need to display some of these fields to the page table. I don't want to use left join now. I want to divide them into four SQL statements for query and then combine them.
However, this may cause a problem: searching for several fields in four tables, sorting and paging the fields will make my cooking more complicated, how can I optimize these operations?
There are other solutions. the efficiency of left join is somewhat low. even if the index is added, how can we put these fields into the page table without using left join, in addition, it is easy to search by page, sort, and search!
------ Solution --------------------
Discussion
Currently, I have four tables and need to display some of these fields to the page table. I don't want to use left join now. I want to divide them into four SQL statements for query and then combine them.
However, this may cause a problem: searching for several fields in four tables, sorting and paging the fields will make my cooking more complicated, how can I optimize these operations?
There are other solutions. the efficiency of left join is somewhat low. even if the index is added, how can we put these fields in the page table without using left join ......
------ Solution --------------------
Integrate fields into a table.
Building indexes well won't be slow, as long as everything is properly planned
You must know that mysql has many restrictions, and even indexes do not do what you want.
You are too harsh on the normal classification of fields in each table. if you do not want to join the fields across four tables, it is too slow to index.
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