How to set a maximum execution time for a mysql query?

I thought it has been around a little longer, but according to this, MySQL 5.7.4 introduces the ability to set server side execution time limits, specified in milliseconds, for top level read-only SELECT statements. SELECT /*+ MAX_EXECUTION_TIME(1000) */ –in milliseconds * FROM table; Note that this only works for read-only SELECT statements. Update: This variable … Read more

Script runtime execution time limit

One thing you could do (this of course depends on what you are trying to accomplish) is: Store the necessary information (i.e. like a loop counter) in a spreadsheet or another permanent store(i.e. ScriptProperties). Have your script terminate every five minutes or so. Set up a time driven trigger to run the script every five … Read more