I have just noticed this from section 13.4.5. LOCK TABLES 
and UNLOCK TABLES Syntax of the 5.0.18 ref manual, and 
wondered if it will help improve the speed of your query:

<snip>
Normally, you do not need to lock tables, because all single 
UPDATE statements are atomic; no other thread can interfere 
with any other currently executing SQL statement. However, 
there are a few cases when locking tables may provide an 
advantage: 

If you are going to run many operations on a set of MyISAM 
tables, it is much faster to lock the tables you are going 
to use. Locking MyISAM tables speeds up inserting, updating, 
or deleting on them. The downside is that no thread can 
update a READ-locked table (including the one holding the 
lock) and no thread can access a WRITE-locked table other 
than the one holding the lock. 

The reason some MyISAM operations are faster under LOCK 
TABLES is that MySQL does not flush the key cache for the 
locked tables until UNLOCK TABLES is called. Normally, the 
key cache is flushed after each SQL statement. 
</snip>

Regards

Keith Roberts

In theory, theory and practice are the same;
in practice they are not.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to