Regarding database optimization, there are many theoretical things on the Internet, none of which are very Public Life. I want to know what problems have been encountered in actual combat and which database optimization methods have been adopted to solve the problems.
The first is to execute all SQL statements appearing in the project
ExplainAnalysis, for example, there are 5 statements that all use a certain table, which must be comprehensively analyzed, with appropriate indexes added orJoint index. Because ..The more indexes, the better. If indexes exist, the maintenance indexes need to be updated for each insertion and deletion of the database., may do more harm than good.
If the amount of data is large enough, consider partitioning tables.