Problem: open the homepage there is no problem, is to open the list of users is very slow, and prompt page no response, as shown in figure 30 seconds to open the page,
The great spirit guide, be obliged!
CodePudding user response:
https://blog.csdn.net/yenange/article/details/61196136With log files record the slow SQL, first know which SQL is slower, specific analysis,
If you know which SQL is slow, the slow SQL directly to the post,
CodePudding user response:
# Time: 200105 11:18:51@ # User @ Host: sspanel [sspanel] localhost []
Lock_time # Query_time: 3.905083:0.000021 Rows_sent: 0 Rows_examined: 3162006
The SET timestamp=1578223131;
Select * from ` alive_ip ` where ` datetime ` & gt;='1578223037' and ` userid `='16' order by ` userid ` desc;
# Time: 200108 3:02:25
@ # User @ Host: sspanel [sspanel] localhost []
Lock_time # Query_time: 4.506483:0.000011 Rows_sent: 0 Rows_examined: 3207817
The SET timestamp=1578452545;
Select * from ` alive_ip ` where ` datetime ` & gt;='1578452451' and ` userid `='27' order by ` userid ` desc;
CodePudding user response:
1 any relevant index?2 these queries, the result set how much?
3 how execution plan?