> -----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 | 126.96.36.199: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
> 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
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.
Explain SELECT * FROM `account` WHERE accountid='2583092';
That will tell you what indexes it is using, if any