MySQL Forums
Forum List  »  MyISAM

Re: Which blocks which?
Posted by: Ingo Strüwing
Date: January 25, 2006 03:49AM

Hi.

Should it? Indeed it would be possible to go through the list of open tables, find the table in question, check, which thread locked it, and get the command that the thread is executing.

But I doubt that this is implemented. At least I don't know a command that could do the above. So you seem to need to guess.

From your description I assume that the "blocked" state persists for some time. This would mean that the table is locked by a "slow query". You could turn on the "slow query log" (http://dev.mysql.com/doc/refman/4.1/en/slow-query-log.html). In the log file you could search for the command that works with the table in question.

Every command locks all tables it works with at the beginning of its execution and unlocks them at the end. However there are some execeptions with subqueries. They might release read locks before the end of the command.

Regards,
Ingo

Ingo Strüwing, Senior Software Developer - Storage Engines
MySQL AB, www.mysql.com

Options: ReplyQuote


Subject
Views
Written By
Posted
2593
January 24, 2006 10:10AM
Re: Which blocks which?
1794
January 25, 2006 03:49AM
1801
January 25, 2006 06:55PM


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.