When a data query on a single table 5000W data is passed two single-column index criteria, when a composite index query, if the last order by ID sort, and remove the sort, the performance gap is close to two orders of magnitude
Conclusion: When using the default ordering of columns, you should not order by the column
By the way, record the other SQL performance issues encountered:
1, limit A, or a value is too large, can also lead to severe performance degradation, the solution is to obtain a batch of data to get the maximum ID, and then add in the query criteria > that ID only need to limit the number of one to get
2, when the condition is updated, if the amount of data is too large, first use the condition to query the column primary key to be modified, and then update the condition with the primary key to improve performance
MySQL Monitoring database statement creating sort index time too long problem