List:General Discussion« Previous MessageNext Message »
From:Steven Staples Date:May 14 2012 1:04pm
Subject:RE: Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz this
View as plain text  
> -----Original Message-----
> From: Andrés Tello [mailto:mr.criptos@stripped]
> Sent: May 12, 2012 10:08 AM
> To: mysql
> Subject: Mysql is toying me... why sometimes an insert or update can be
> slow!? I getting bald cuz this
> 
> While doning a batch process...
> 
> show full processlist show:
> 
> | 544 | prod | 90.0.0.51:51262 | tmz2012 | Query   |    6 |
> end                          | update `account` set `balance`= 0.00 +
> '-4000' where accountid='2583092'
> 
> No other process, lo locking no nothing...
> 
> so you take this same query... run it isolated, and the mu....fu... is
> just...f.... fast!!!!!
> 
> 
> update `account` set `balance`= 0.00 + '-4000' where accountid='2583092'
> Query OK, 0 rows affected (0.00 sec)
> Rows matched: 1  Changed: 0  Warnings: 0
> 
> 
> ARRRG!  I have seen this type of query take as long as 100+ seconds.. and
I
> don't have a F*** clue...
> 

2 things come to mind here...

1)  indexes could not be set, so it may cause huge slowdowns on bigger
tables

2)  it could have been fast because of query caching, so it may have cached
the "index" you were updating for, which may make it work fast.  Also, if
you run it manually, the first time may be slow, and subsequent attempts are
faster (again, caching)

I may be wrong here, but something to check out.

Try this:

Explain SELECT * FROM `account` WHERE accountid='2583092';

That will tell you what indexes it is using, if any


Steve

Thread
Mysql is toying me... why sometimes an insert or update can be slow!?I getting bald cuz thisAndrés Tello12 May
  • RE: Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz thisSteven Staples14 May
  • Re: Mysql is toying me... why sometimes an insert or update can beslow!? I getting bald cuz thisAnanda Kumar14 May
    • Re: Mysql is toying me... why sometimes an insert or update can beslow!? I getting bald cuz thisAndrés Tello14 May
      • Re: Mysql is toying me... why sometimes an insert or update can beslow!? I getting bald cuz thisAnanda Kumar14 May
        • Re: Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz thisJohan De Meersman14 May
          • Re: Mysql is toying me... why sometimes an insert or update can beslow!? I getting bald cuz thisAnanda Kumar14 May