MySQL Forums
Forum List  »  MyISAM

Re: SELECT queries Locking Problems
Posted by: Rick James
Date: April 02, 2009 08:28PM

In PROCESSLIST...
"Sleep" means that the client is still connected, but is not executing any query at the moment. Perhaps it is busy processing someting. Perhaps it failed to disconnect. Your PHP code 'should' call disconnect, although there is usually no harm in not doing it.

"Unauthenticated user" is probably one of the early states of a client logging in.

Show us the INSERT/UPDATE/... query that is running (and presumably has the table locked).

MyISAM does only "table locking". That is, when a write operation starts to act on a table, it locks the table, not allowing anything else to touch the table. If you INSERT one row, that is so brief that it would be hard to ever notice it. If you DELETE 10,000 rows in a single statement, that will keep the lock for a long time. If a SELECT were to run during the DELETE, it would probably get quite confused, possible crash because of pointers being changed by the DELETE. MyISAM uses code that is fast and simple. InnoDB uses complex code to allow SELECT to run while DELETE is running. But even there, you can get into deadlocks, aborted statements, etc.

Options: ReplyQuote


Subject
Views
Written By
Posted
8837
March 21, 2009 01:43AM
3554
March 21, 2009 11:35PM
3075
March 27, 2009 08:24PM
2904
March 29, 2009 11:58PM
3146
March 30, 2009 12:08AM
3019
April 02, 2009 05:15AM
Re: SELECT queries Locking Problems
3064
April 02, 2009 08:28PM


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.