I have a problem with simple update query what always appearing in my mysql-slow-query.log table is not big and contain just only 3021 rows
.
the query looks like :
UPDATE 'address'
SET 'user' = 1013
WHERE 'id_adress' = '1'
AND 'date' = '2012-06-04'
Query_time: 2.664413 Lock_time: 0.000043 Rows_sent: 0 Rows_examined: 1
when I examinate this query with:
select 'user' = 1013
from 'address'
where 'id_adress' = '1'
AND 'date' = '2012-06-04'
then looks very fast 1 row in set (0.00 sec)
Why this simple update query take such a lot of time? How to fix it?
first check if your table is not crashed,
if it is then repair your the table.
second try to index those two fields used in where clause
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With