LoginSignup
8
4

More than 5 years have passed since last update.

MySQLのスロークエリログの時間制御が効かない時はlog-queries-not-using-indexesを確認

Posted at

MySQLのスロークエリログで明らかに
long_query_timeで設定した時間よりも短い結果で返ってくるクエリが保存されていた

原因はlog_queries_not_using_indexesがONになっていた。
これがONになっているとインデックスを使っていないクエリが保存される

従って、下記設定でlog_queries_not_using_indexesをOFFにする。
mysql>set global log_queries_not_using_indexes=0;

これで、long_query_timeでスロークエリを制御できる

8
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
4