I'm debugging an issue where sql select query sometimes doesn't return results when it should. I have no idea if the problem lies within the plugin I'm using, libmysql library, or the mysql database itself. So - I'd like to log all queries on database level, and log the number of rows returned. I enabled general query log, but it only stores the queries executed. Is there way to log execution time and number of rows returned as well? Thank you.
Asked
Active
Viewed 1,699 times
1 Answers
1
Depending on your MySQL version additional information can be logged to the slow log. Including rows_examined and rows_sent.
For example, see Percona's additions to the slow log

akuzminsky
- 2,190
- 15
- 21
-
That's a good start, but the long_query_time minimal limit is 1. The queries aren't slow (at most 0.8 ms), they just tend to lose results. Is there some hack to consider all queries as "slow"? – Misiur Feb 14 '14 at 16:32
-
1long_query_time can be 0, effectively logging all queries. Even community version of MySQL since 5.1.something supports that – akuzminsky Feb 14 '14 at 16:39
-
"Beginning with MySQL 5.1.21, the minimum is 0, and the value can be specified to a resolution of microseconds" - How did I miss that? Thanks! – Misiur Feb 14 '14 at 16:40