"howa" <EMAIL REMOVED> wrote:
> from show full processlist...
>
>| Locked | UPDATE my_db_users SET ...
>| Copying to tmp table | SELECT * FROM my_db_articles a LEFT JOIN my_db_users u ON a.user_id = u.id WHERE a.text like '%test%'...
>| Locked | SELECT * FROM my_db_users WHERE id = ....
.... (more locked SELECTs)
>
> any comments?
Normal behaviour.
One SELECT (the second thread in your list) holds a read lock on the
my_db_users table. The UPDATE is waiting for this lock to disappear.
The other SELECTs could have been done together with the already
running select. However the UPDATE has higher priority. Therefore
those other SELECTs are waiting for the UPDATE to finish.
(I explained that to you some days ago).
The reason for giving writes a higher priority than reads is simple:
otherwise writes could have to wait for a very long time - even
endless if enough reads coming in.
XL
--
Axel Schwenke, Support Engineer, MySQL AB
Online User Manual:
http://dev.mysql.com/doc/refman/5.0/en/
MySQL User Forums:
http://forums.mysql.com/