Follow hsp step by step to learn how to optimize mysql

  • 2020-05-17 06:42:44
  • OfStack

It's in episode 2

1.show status like 'Com%' is equivalent to show status session like 'Com%' centenary -- displays the current console situation

show global status like 'Com%'-- shows the number of times the database has been queried from start to start

show session status like 'Com_select';

show status like 'uptime' -- how long has it been running
show status like 'Connections' -- number of connections

Number of times slow_queries slow queries (default is 10)


For the Myisam database, clean it regularly.
optimize table table name, otherwise its deletion record is not empty
order by null disables sorting
Replace the subquery with join
In finance, you can use fixed-point Numbers to put data decimal, not float, because float will lose data. Such as float (10, 5),
For date types, use numeric values instead of datastmp



Related articles: