Sometimes the MySQL database we use generates files on the /tmp
disk to temporary store results when performing a query.
On StackOverflow there are a lot of posts on how to disable this behavior or speed it up by for instance using a RAM disk.
I'm looking however for an elegant way to save the queries that have generated such files since I believe most of these queries can be optimized.
Is there a way to log these queries?