Records stored in mysql are generally not divided into fields and are stored as a whole.
Tools for optimizing SQL include: explain: used to analyze whether to apply indexes and the number of scanned records; slow log generally records SQL statements whose execution time is greater than a certain value; show profiles generally analyzes data on IO, Memory, CPU, etc.
It is recommended to use Alibaba's druid database connection pool. Configure it to record all SQL execution statistics for a period of time. There will be a web page that can be accessed, which is very helpful for SQL execution analysis. However, the cache of this thing takes up a lot of space, and it cannot count long-term running conditions. It is very suitable for analyzing the amount of data for several hours.
Records stored in mysql are generally not divided into fields and are stored as a whole.
Tools for optimizing SQL include: explain: used to analyze whether to apply indexes and the number of scanned records; slow log generally records SQL statements whose execution time is greater than a certain value; show profiles generally analyzes data on IO, Memory, CPU, etc.
Use execution plan, explain
Set in my.cnf
Slow query log analysis tool officially provided by mysql
mysqldumpslow mysql-slow
Also
mysqlsla
Use explain command
Must explain
It is recommended to use Alibaba's druid database connection pool. Configure it to record all SQL execution statistics for a period of time. There will be a web page that can be accessed, which is very helpful for SQL execution analysis. However, the cache of this thing takes up a lot of space, and it cannot count long-term running conditions. It is very suitable for analyzing the amount of data for several hours.