SQL slow query causes CPU memory to reach 100%, what should I do?
赵泽鑫
赵泽鑫 2022-08-11 11:19:09

It is said that there are a large number of slow query records in the database, and the execution time is too long, resulting in resource exhaustion. What should I do? Delete mysql-bin.XXXXXXX and mysql-bin.XXXXXXX in mysql-bin.index. Delete mysql-slow.log and rebuild log-bin=mysql-binbinlog_format=mixedserver-id = 1expire_logs_days = 10slow_query_log=0slow. -query-log-file=/www/server/data/mysql-slow.loglong_query_time=1#log_queries_not_using_indexes=on

赵泽鑫
赵泽鑫

reply all(1)
大瓶可乐

See if we can create an index to optimize

  • reply Please tell me how to create an index, thank you.
    赵泽鑫 author 2022-08-11 11:46:00
  • reply Baidu searches for commands on how to create an index for a data table, or create it directly with a tool
    lx author 2022-08-12 14:08:15
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!