After MySQL splits a master table into multiple tables, how does one solve the query efficiency problem?
Source: Internet
Author: User
Php Chinese network (www.php.cn) provides the most comprehensive basic tutorial on programming technology, introducing HTML, CSS, Javascript, Python, Java, Ruby, C, PHP, basic knowledge of MySQL and other programming languages. At the same time, this site also provides a large number of online instances, through which you can better learn programming... Reply content: http://wenku.baidu.com/view/aa43ecc3aa00b52acfc7ca94.html? St = 1
How can I score the answer here? Sharding? You can try the amoeba project.
Http://docs.hexnova.com/amoeba/
Simply put, after a table is sharded by a specific rule, you write the rule and it becomes a very good proxy. you access it just like accessing a complete table.
I have used it before to implement read/write splitting without modifying the front-end code. it is a good intermediate role.
To meet your project requirements, check whether the stability also needs to be tested. if you split 10 tables, you need to perform a merge query, that is, the data in the 10 tables is queried and then merged and returned. my current solution is to merge the results after multi-threaded query. if the thread pool is set to a large value, the speed will be faster, however, you must dynamically adjust the number of threads according to your own situation. What are the conditions for splitting a base table? The corresponding query statement must have been modified, but this question is not clear. the landlord should describe it more clearly. normal table splitting is mainly for the purpose of resisting pressure. if it is said that a single SQL query is slow, this is not a problem of table splitting. it is a problem of SQL. of course, it may be slow because there is no way to split the table.
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