Anyway to Limit MySQL Query Execution time?

Hi I'm having issues on my server at the minute because some of the MySQL queries are taking a very long time to run, and hogging the resources on the server.

I'm already in the process of optimising all the queries to improve the performance, but as we use a fair amount of 3rd party applications on the server using mysql I was hoping to put in place a safeguard to prevent future issues.

What I need is something I can put in place server wide that will apply to all queries but with the possibility of overriding it on a per query basis for some of the more complex reports that do take some time to run.

I've spent time googling to find a solution but so far no luck,

Thanks for your help

This question and answers originated from www.stackoverflow.com
Question by (11/24/2011 9:23:15 AM)

Answer

There is no way to do it using MySQL options. But you can still do it using daemon process as @rabudde advised.

In this case, if you kill process you will abort transaction and it will be rollback.

Answer by

Find More Answers
Related Topics  mysql
Related Questions
  • How to controll Mysql query execution time?

    I have several EVENTS executing every two seconds, I would like to kill those which are running longer than 1 second. Are there way to control query execution time on MySQL 5.5? cheers Arman.…
  • MYSQL query execution time

    I have a question for you. I have this database with 250.000 recordings, with 2 text fields each containing up to 300 words. And I want do select all the data that meets some criteria and put it in …
  • MySql query execution time

    I am using MySQL Workbench on Windows. How do I find out the time taken to execute a query like Select * from employers where employerid > 200 Is there a statement I can enter that returns…
  • Strange mysql query execution time behavior

    hello i'm having a strange execution time behavior over almost same sql queries q1: SELECT `t1`.`id`, `t1`.`key`, `t1`.`module`, `t2`.`value` FROM `translates` AS `t1` LEFT JOIN `translates_…
  • mysql query execution time | reduce query

    I have a query which let me to change users order. here is my query: update test set orderID = case orderID when (select orderID from ( select * from test where orderID > ( select …
  • problem in mysql query with join and limit the time

    i have this SELECT COUNT(1) cnt, a.auther_id FROM `posts` a LEFT JOIN users u ON a.auther_id = u.id GROUP BY a.auther_id ORDER…
  • MySQl Query Execution Plan

    Does MySQL optimizer changes the execution plan based on the WHERE condition ? If I add one extra column for the comparison in WHERE condition , does it affect query execution plan ? Thanks, S…
  • How to limit query results with Mysql

    Newbie question: I've got an email message table that's got a message_id field (primary key field) and other fields like body, receiver_id, sender_id and parent_id. The parent_id field is what co…
  • Is there anyway to do math on a MySQL query?

    I have two fields, one with the purchase date and one with the lifespan of an item. I am wondering if there is any way to determine if the current date is past the lifespan. So, pretty much if MySQL…
  • How to set a maximum execution time for a mysql query?

    I would like to set a maximum execution time for sql queries like set_time_limit() in php. How can I do ?