Can I set a timeout for a specific UPDATE query

Discussion in 'Databases' started by zivha, Mar 8, 2009.

  1. #1
    Hello,

    I would like to know if and how I can implement the following. I have a simple update query that increments a counter in a table:

    $result = mysql_query("UPDATE mytable set count = count + 1 WHERE id=10 LIMT 1");

    The update increments some statistics counter which is not extremely important. I found out that at times when there is heavy load on the web site other SELECT and database activities can make this UPDATE run very slow. This also happens during database backups.

    I wonder if there is a way to tell SQL for this specific query that if the UPDATE can not be executed after T milliseconds the query should fail.

    Anyone knows if this can be done? how?

    Thanks!

    Ziv
     
    zivha, Mar 8, 2009 IP
  2. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #2
    I have never seen to set such value for particular SQL query.

    Kailash
     
    kailash, Apr 4, 2009 IP