MySQL Database optimization

Source: Internet
Author: User

When it comes to optimization, determine whether the problem is the storage engine selection problem, the SQL statement usage problem (such as index), or a single storage server's tens of data.

Workaround:
1, according to different business selection of different storage engine, although the general situation is preferred to choose InnoDB.

2. Analyze the effect result set of SQL statement. Check the query log, locate the SQL statement for the slow query, and see if there is a locked SQL operation.

3, sub-Library, sub-table, partition (careful use of partitions, often OLTP operations do not apply to the partition, the partition will slow down the original query)
4, the use of cache or NoSQL instead of some of the existing hot query operations, reduce the mysql pressure.
Can be split based on business logic, different services distributed across different servers, reducing single server pressure
Two ways of vertical and horizontal table

Vertical table: Separate the frequently updated and infrequently updated fields in the table


Horizontal sub-table, three kinds of sub-table way:

Equal sub-table, hash table, the advantage is the average distribution of load, the disadvantage is that when the capacity continues to increase the expansion of prosperity is inconvenient, need to re-table, the primary key is very bad processing.

Time tables, based on different creation time tables, are suitable for OLAP applications.

MySQL Database optimization

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.