This article is also available in Chinese: 中文版. Browse all English articles.
If you use and operate MySQL, you’ve surely run into a strange slow query like this:
- An
INSERTthat’s normally instant took1.3s, and the slow-query log shows no long lock wait. - Every statement in a multi-statement transaction had already
finished, yet the
COMMITalone took1.3s.
When this happens, the most likely cause is a large transaction committing. Below is a simulated test: we used sysbench to simulate a normal workload, then ran a large UPDATE in the background every 5 seconds. You can see the large UPDATE severely hurts performance.
Root Cause
The …
[Read more]