表上的 sql select 查询未完成

发布于 2024-11-01 21:50:25 字数 424 浏览 4 评论 0原文

我在从名为节点的表中读取数据时遇到了这个奇怪的问题。任何选择查询都需要永远执行。我什至不知道它最终是否会回来,但看起来并非如此。以前恢复得很快。据我所知,一切都没有改变。没有插入新记录,也没有删除任何记录。我尝试过的几个查询。

select count(1) from  nodes;

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

如果有帮助的话,node_id 是节点表中的主键。前一天,所有选择查询都会立即返回,例如 0.01 毫秒等。

我的猜测是,不知何故在表上放置了一个锁,阻止我的查询继续进行。 如果有人能让我知道或指导如何在 MYSQL 5.0.90-log FreeBSD 中查找特定表上的锁,我将不胜感激。

还有什么其他可能性?

非常感谢。

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 possibilities?

Thanks a bunch.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

青春如此纠结 2024-11-08 21:50:25

我将这个问题上报给我们团队的一位高级员工。他认为当 mysqld 尝试记录时,文件系统已满。通过停止 mysqld 并创建指向具有大量可用空间的不同文件系统上的文件的符号链接可以解决此问题。启动 mysqld 并且所有选择查询都在无阻塞地运行。

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.

凉薄对峙 2024-11-08 21:50:25

尝试查看服务器上的进程,也许您必须杀死其中的某个进程才能释放表。

这是一个有趣的链接:
http://mysqlpreacher.com/wordpress/2009/07/mysql- processlist-showkill-processes/

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/

一袭水袖舞倾城 2024-11-08 21:50:25

首先尝试重新启动 sql 服务,如果没有帮助,请重建索引。

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

平定天下 2024-11-08 21:50:25

可能是索引被盗了。尝试重建所有索引。

May be indexes got curropted. Try rebuilding all indexes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文