MySQL Forums
Forum List  »  Performance

Update vs Select lock
Posted by: Frank Grunwald
Date: November 10, 2004 08:02AM

Hi all,

I'm looking for an efficient way to give a highest priority to an update query than a select query.
This is an example :
Every X minutes, a script has to run a SELECT * FROM t1 in order to perform some reports on it. This query may length from 1 to 2 mn. It's a low priority script, il doesn't need to run fast; it doesn't need to have the latest values
All the time, an application runs update on the table t1 :
UPDATE t1 SET c1='toto';
When this query comes while a Select query is being performed, it gets locked until the Select ends what is completely unacceptable to my application.

How could I do to get the Update query done without waiting for the Select to end (I don't care if the select gets locked, I don't care if it doesn't see the Update that was done while it was running). I tryed all types of READ / WRITE Lock but I can't get the SELECT query to be stopped by anything else while it is running.
The tables are stored under MyIsam.

Does anyone have an idea ?
Thanks for your help

Frank

Options: ReplyQuote


Subject
Views
Written By
Posted
Update vs Select lock
4963
November 10, 2004 08:02AM
2576
November 12, 2004 09:27AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.