At 04:31 PM 12/30/2005, Scott Baker wrote:
Is there a way to tell mysqld to stop running a query if it hasn't
completed in over 60 seconds? Or how about stop running if the result is
greater 100,000 rows or something? I have a bone head user who keeps
querying two tables and NOT joining them, and then dragging the DB server
down while it crunches this useless query.
How can I prevent this?
Scott
Scott,
Have you tried electo-shock? Tasers are really good for this.
Sneak up on him and zap him in the back of the neck. By the time he wakes
up, it's quitting time. (Just kidding, don't try this at home kiddies<g>)
Unfortunately MySQL doesn't have anything related to restricting CPU usage.
http://dev.mysql.com/doc/refman/5.0/en/user-resources.html
You could write a small program that would execute a "show process list"
every 30 seconds and if that user has a Select query running for more than
30 seconds, just have the program execute a Kill command. I know it's not
as much fun as using a Taser, but you won't have to get up out of your
chair to zap him.<g>
Mike
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]