You might know if you have long running transactions you’re
risking having a lot of “garbage” accumulated in undo segment
size which can cause performance degradation as well as increased
disk space usage. Long transactions can also be bad for other
reasons such as taking row level locks which will prevent other
transactions for execution, this however only applies to read
transactions while problem with undo space growth exists for read
only transactions as well.
This is how long transaction looks:
---TRANSACTION 17402D749, ACTIVE 15867 sec, process no 19349, OS thread id 1630148928 MySQL thread id 188790, query id 14796224615 host.domain.com 127.0.0.1 root
It was running over 4 hours so Innodb could be preventing purge from happening for long time and there could be a lot of garbage in undo segment. If you’re running Percona Server it is easy to check:
mysql> select * from …[Read more]