MySQL database executes analyze to collect information
MySQL TutorialThe column executes analyze to collect information. Introduction to the fault Before, a developer came to me and asked about a certain function of the application It was much slower than before, so the development provided slow SQL statements. I went to the corresponding MySQL database to look at the execution plan and found that the execution plan was incorrect. The first reaction was that the statistical information of one of the tables was inaccurate, resulting in the SQL statement The execution plan is wrong, from efficient query SQL to slow SQL. After locating the problem, it is natural to analyze and collect information again. At this time, all the selects on the analyze table suddenly get stuck and do not return any results. Then the application explodes, and various alarm messages are sent. Fault recovery At that time, the analyze operation was performed by a slave library, which was basically affected by the select query, so the query is simulated here operate. Create a simulation table mysql> select * from t_test_1; +—-+——–+——-+——–+ | id | name | name2 | status | +—-+——–+——-+——–+ | 1 | name1 | 1001 | 0 | | 2 | name1 | 1002 |…