With the accumulation of data, slowly some of our bad habits will be exposed in the system, the efficiency of the program execution is low, the user experience is reduced, if we do not take some measures, then users will be lost.
Improving the execution efficiency of your program may require a lot of work, but one of the important tasks is MySQL optimization, or database optimization.
Optimization direction
1. Rationalization of table design (database paradigm)
2. Add an appropriate index (primary key index, unique index, normal index, full-text index)
3. Efficient SQL (SQL statement optimization, especially slow query)
4. Sub-table technology (horizontal split, vertical division)
5. Read and write separation
6. Stored Procedures (precompiled SQL statements for improved execution efficiency)
7. Configuration optimizations such as maximum concurrency
8.mysql hardware upgrade (hardware is flawed)
9. Regular removal of useless data (useless data, memory also affect query efficiency)
10. Timed defragmentation
If each case is recorded, it will cause this article to be too large, so I will make a separate record of the learning of each case.
MySQL Optimization direction