I have a very slow query that is built by the ORM and I'm curios how could I find out the exact query being executed.
I cannot monitor it from the mys开发者_高级运维ql-slow.log
because it never finishes the execution (as in I don't have eternity to wait for it, more than an hour in an still waiting).
Also I cannot get the query from the ORM, just after execution. And the only way I think of getting it is from the process list.
show processlist \G
But my problem is that most of the query is trimmed of, even before the from
keyword.
This question has been asked before but with no answer https://stackoverflow.com/questions/3741356/find-queries-from-process-id-mysql-5-1-x
Any suggestions?
If your query is formatted in multiple lines, some MySQL clients will only display the first line. To see full output run SHOW FULL PROCESSLIST;
query in MySQL console.
精彩评论