当MySQL处于“发送数据"状态时,这是什么意思? [英] What does it mean when MySQL is in the state "Sending data"?

查看:74
本文介绍了当MySQL处于“发送数据"状态时,这是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果Mysql查询是什么意思?

What does it mean if the Mysql query:

SHOW PROCESSLIST;

返回状态"列中的发送数据"?

returns "Sending data" in the State column?

我想这意味着查询已经执行,MySQL正在向客户端发送结果"数据,但是我想知道为什么它要花费这么多时间(最多一个小时).

I imagine it means the query has been executed and MySQL is sending "result" Data to the client but I'm wondering why its taking so much time (up to an hour).

谢谢.

推荐答案

这是一种令人误解的状态.它应该被称为读取和过滤数据".

This is quite a misleading status. It should be called "reading and filtering data".

这意味着MySQL的某些数据存储在磁盘(或内存)中,尚待读取和发送.它可能是表本身,索引,临时表,排序后的输出等.

This means that MySQL has some data stored on the disk (or in memory) which is yet to be read and sent over. It may be the table itself, an index, a temporary table, a sorted output etc.

如果您有一个1M记录表(不带索引),而该表只需要一个记录,则MySQL仍在扫描表时将状态输出为正在发送数据",尽管该表尚未发送任何内容

If you have a 1M records table (without an index) of which you need only one record, MySQL will still output the status as "sending data" while scanning the table, despite the fact it has not sent anything yet.

这篇关于当MySQL处于“发送数据"状态时,这是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆