Mysql optimization direction
With the accumulation of data, slowly some of our bad habits will be exposed in the system, the efficiency of program execution is low, the user experience decreases, if we do not take some measures, then users will be lost.
It may take a lot of work to improve the execution efficiency of the program, but one of the important work is mysql optimization, or database optimization.
Optimization direction
1. Rationalization of table design (database paradigm)
two。 Add appropriate indexes (primary key index, unique index, general index, full-text index)
3. Efficient sql (sql statement optimization, especially slow queries)
4. Sub-table technology (horizontal segmentation, vertical segmentation)
5. Separation of reading and writing
6. Stored procedures (precompiled sql statements that improve execution efficiency)
7. Configuration optimization such as maximum concurrency
8.mysql hardware upgrade (hardware is hard)
9. Regularly clear useless data (useless data, which occupies memory and affects query efficiency)
10. Timing defragmentation
If each situation is recorded, it will lead to too much space in this article, so I will record the learning of each situation separately.