Server bogged and mysql query slow log
I have serious performance problem (all of a sudden) on my server (PHP+MySQL). I enabled MySQL slow query log and he started to show some开发者_JAVA百科 queries that were taking even 25 secs to complete. for example this one takes 15 seconds:
# Time: 110823 2:07:01
# User@Host: ***[***] @ localhost []
# Query_time: 15 Lock_time: 0 Rows_sent: 1 Rows_examined: 1
use ***;
SELECT `users`.*
FROM (`users`)
WHERE `users`.`id` = 4413
ORDER BY `users`.`id` ASC
LIMIT 0, 1;
Point is, on the field Id there is a primary key and if i run the query from phpmyadmin it executes in 0.00008 seconds. This is the explain plan:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE users const PRIMARY PRIMARY 4 const 1
I am really confused, because the hosting provider it is saying everything is fine and is my database. I checked all the parameters with tuning-primer by Matthew Montgomery and all settings seems fine...
I confirm itsmee answer. Database was bogged down from unindexed queries launched many times. They weren't displaying in the mysql-slow log because they were under 1 sec, but they were executed many many times.
精彩评论