The cpu occupied immediately when my company's servers were deployed (I thought the machine was too bad), and it was very loud. I'm really upset.
I can debug the server program. So I will first look at the logs of the tomcat server. It indicates that the server immediately rings when a method is called at a time.
Then I will block this method first... Check the server response. Sure enough, the cpu will not be full immediately. (Can be said to work normally ).
Then I start debugging this method.
I initially thought it was a problem with SQL writing. I wanted to write it again. Later, the manager said that SQL server could use the "Stored Procedure" to solve the SQL efficiency problem.
(Because of my SQL Server database, our manager asked someone to help me write), after a while. The "Stored Procedure" came out. However, the effect is not achieved;
Then I began to rewrite the SQL statement.
Specific SQL: I will not post it.
For example, I want to check the last name in the name field of the "user" table. The old statement is the following SQL statement.
Select * from user where 1 = 1 and name like '% [Li Chen] % ';
Then there is no problem after the query. There is no problem on your own server.
But immediately after arriving at the server, there was a response.
Later I changed it:
Select * from user where 1 = 1 and name like 'Li % 'or name like 'chen % ';
There is no problem. So don't use the symbols in... SQL without understanding them ....
I only know what is wrong with this square brackets... Others will be known later.