First encounter sql optimization problem

Originally, I was happy to upload the code today and felt nothing. After the code was submitted, I waited for the code to be released automatically. I was very happy. I waited for a while to test the interface test. , and then I suddenly felt that something was wrong, other interfaces were normal, but the query of this interface I uploaded didn't respond, something was wrong

Could it be that my sql query is reporting an error. I was thinking about where there was a problem, and the data was found out, but it was too slow and I waited for nearly a minute. Something is wrong, go to the database and run the sql written by yourself to see if there is a problem with the sql. If you don't run, you will be shocked

 It actually took 50 seconds for a statistical query, and now there are more than 10,000 pieces of data in the database, which is too wrong. Then I went to the performance analysis and found that the sending data took up to 49 seconds. Baidu searched, It is found that the table is not retrieved, and the index is supplemented with the speed of beauty

 

 

Record it.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324647381&siteId=291194637