Mysql: 5.7 on AWS RDS
On our production server some queries are running so long.
Here this select was running from 1278013 seconds. We have given the production read access to multiple users and even to the customers and write access to few so might be the case they are executing query through PMA and they are not able to see the result in PMA, but the query is sending data in the background.
What we can do to kill such long running queries.
Solution I suggested:
- set max_execution_time to 1 or 2 hours. Currently it is 0.
Problem with the solution:
- We are not aware the longest running time for query in entire system
- There will be a problem for data correction scripts, which are taking longer than usual, if we set limited time.
Requesting you to please suggest how we can get rid off this in production, as this caused a serious problem of metadata lock in one of the process.