Unionall is inefficient. which method should be used to solve the problem of stored procedures, views, and temporary tables? How to solve
Source: Internet
Author: User
Unionall is inefficient. which method should be used to solve the problem of stored procedures, views, and temporary tables? Union & nbsp; all is inefficient. The union & nbsp; all has dozens of tables. The select statement for a single table takes only 0.0003-0.002 seconds, but union & nbsp; after all, it takes about 0.6 seconds for union all to be less efficient. Which of the following solutions should we use stored procedures, views, and temporary tables?
Union all is inefficient. It takes about 0.0003-0.002 seconds to select a single table with dozens of union all tables, but it takes about 0.6 seconds after union all.
To improve efficiency
In this case, which of the following methods should be used to solve the problem?
------ Solution --------------------
How big is the data volume? When the number of sub-tables is reached. This horizontal score is not reasonable for table sharding.
------ Solution --------------------
After union all, order and so on? Shouldn't it be so big?
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.