开发者

sql select query on a table is not finishing

I'm experiencing this weird problem reading data from a table called nodes. Any select query is taking forever to execute. I don't even know if its going to return eventually but it doesn't seem like that. It used to return quickly before. Nothing has changed as far as I know. No new records are inserted and none are deleted too. Couple of queries that I tried.

select count(1) from  nodes;

select node_id, type from nodes where node_id='abc';

node_id is a primary key in nodes table if that helps. The previous day all of select queries used to return in no time like in 0.01ms etc.

My guess is that somehow a lock is placed on the table preventing my queries from proceeding. I appreciate if someone can let me know or give a pointer to how to find locks on a particular table in MYSQL 5.0.90-log FreeBSD.

What could be other pos开发者_JS百科sibilities?

Thanks a bunch.


I escalated this problem to a senior staff in our group. He figured that when mysqld tried to log, file system has become full. This is solved by stopping mysqld and creating a symbolic link to a file on a different file system that has lots of free space. started mysqld and all select queries are running without blocking.


Try to look at processes on you server, maybe you have to kill someone of them to free the table.

Here is an interesting link about that: http://mysqlpreacher.com/wordpress/2009/07/mysql-processlist-showkill-processes/


First try to restart the sql service if that doesn't help, rebuild the indexes .


May be indexes got curropted. Try rebuilding all indexes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜