I had a long running transaction and general log enabled.
So I wanted to check which queries caused transaction to be running for a long time.
If you have thread id for a long running transaction:
(you can get it from “mysql> show engine innodb status;” or pt-deadlock-logger in case of deadlock)
then you can grep log by thread id and then use pt-query-digest and analyze log
sudo grep -i " <thread id> " <genera-log-filename> > somefile.txt sudo pt-query-digest --type genlog somefile.txt
My main background for a recent years is MySQL DEV/DBA engineer but I’m also participating in wider range of tasks which could be likely called as DataOps/DevOps tasks. You can see my online CV here: http://catyellow.net