当前位置: 首页 > news >正文

Mysql的Profile中的status的常量含义

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

今天同事问show profile的时候出现了多次sending data,sendingdata 到底是什么意思?

于是上网找了下mysql的相关文档,先摘录下来,有空翻译下。

6.5.5.2. General Thread States

The following list describes thread State values that are associated with general query processing and not more specialized activities such as replication. Many of these are useful only for finding bugs in the server.

  • After create

    Occurs when the thread creates a table (including internal temporary tables), at the end of the function that creates the table. This state is used even if the table could not be created due to some error.

  • Analyzing

    The thread is calculating a MyISAM table key distributions (for example, for ANALYZE TABLE).

  • Checking table

    The thread is performing a table check operation.

  • cleaning up

    The thread has processed one command and is preparing to free memory and reset certain state variables.

  • closing tables

    Means that the thread is flushing the changed table data to disk and closing the used tables. This should be a fast operation. If not, you should verify that you do not have a full disk and that the disk is not in very heavy use.

  • converting HEAP to MyISAM

    The thread is converting an internal temporary table from a MEMORY table to an on-disk MyISAM table.

  • copy to tmp table

    The thread is processing an ALTER TABLE statement. This state occurs after the table with the new structure has been created but before rows are copied into it.

  • Copying to group table

    If a statement has different ORDER BY and GROUP BY criteria, the rows are sorted by group and copied to a temporary table.

  • Copying to tmp table

    The server is copying to a temporary table in memory.

  • Copying to tmp table on disk

    The server is copying to a temporary table on disk. The temporary result set was larger than tmp_table_size and the thread is changing the temporary table from in-memory to disk-based format to save memory.

  • Creating index

    The thread is processing ALTER TABLE ... ENABLE KEYS for a MyISAM table.

  • Creating sort index

    The thread is processing a SELECT that is resolved using an internal temporary table.

  • creating table

    The thread is creating a table. This includes creation of temporary tables.

  • Creating tmp table

    The thread is creating a temporary table in memory or on disk. If the table is created in memory but later is converted to an on-disk table, the state during that operation will be Copying to tmp table on disk.

  • deleting from main table

    The server is executing the first part of a multiple-table delete. It is deleting only from the first table, and saving fields and offsets to be used for deleting from the other (reference) tables.

  • deleting from reference tables

    The server is executing the second part of a multiple-table delete and deleting the matched rows from the other tables.

  • discard_or_import_tablespace

    The thread is processing an ALTER TABLE ... DISCARD TABLESPACE or ALTER TABLE ... IMPORT TABLESPACE statement.

  • end

    This occurs at the end but before the cleanup of ALTER TABLECREATE VIEWDELETEINSERTSELECT, or UPDATE statements.

  • Execution of init_command

    The thread is executing statements in the value of the init_command system variable.

  • freeing items

    The thread has executed a command. This state is usually followed by cleaning up.

  • Flushing tables

    The thread is executing FLUSH TABLES and is waiting for all threads to close their tables.

  • FULLTEXT initialization

    The server is preparing to perform a natural-language full-text search.

  • init

    This occurs before the initialization of ALTER TABLEDELETEINSERTSELECT, or UPDATE statements.

  • Killed

    Someone has sent a KILL statement to the thread and it should abort next time it checks the kill flag. The flag is checked in each major loop in MySQL, but in some cases it might still take a short time for the thread to die. If the thread is locked by some other thread, the kill takes effect as soon as the other thread releases its lock.

  • Locked

    The query is locked by another query.

  • logging slow query

    The thread is writing a statement to the slow-query log.

  • login

    The initial state for a connection thread until the client has been authenticated successfully.

  • Opening tablesOpening table

    The thread is trying to open a table. This is should be very fast procedure, unless something prevents opening. For example, an ALTER TABLE or a LOCK TABLE statement can prevent opening a table until the statement is finished.

  • preparing

    This state occurs during query optimization.

  • Purging old relay logs

    The thread is removing unneeded relay log files.

  • query end

    This state occurs after processing a query but before the freeing items state.

  • Reading from net

    The server is reading a packet from the network.

  • Removing duplicates

    The query was using SELECT DISTINCT in such a way that MySQL could not optimize away the distinct operation at an early stage. Because of this, MySQL requires an extra stage to remove all duplicated rows before sending the result to the client.

  • removing tmp table

    The thread is removing an internal temporary table after processing a SELECT statement. This state is not used if no temporary table was created.

  • rename

    The thread is renaming a table.

  • rename result table

    The thread is processing an ALTER TABLE statement, has created the new table, and is renaming it to replace the original table.

  • Reopen tables

    The thread got a lock for the table, but noticed after getting the lock that the underlying table structure changed. It has freed the lock, closed the table, and is trying to reopen it.

  • Repair by sorting

    The repair code is using a sort to create indexes.

  • Repair done

    The thread has completed a multi-threaded repair for a MyISAM table.

  • Repair with keycache

    The repair code is using creating keys one by one through the key cache. This is much slower than Repair by sorting.

  • Rolling back

    The thread is rolling back a transaction.

  • Saving state

    For MyISAM table operations such as repair or analysis, the thread is saving the new table state to the .MYI file header. State includes information such as number of rows, the AUTO_INCREMENT counter, and key distributions.

  • Searching rows for update

    The thread is doing a first phase to find all matching rows before updating them. This has to be done if the UPDATE is changing the index that is used to find the involved rows.

  • Sending data

    The thread is processing rows for a SELECT statement and also is sending data to the client.

  • setup

    The thread is beginning an ALTER TABLE operation.

  • Sorting for group

    The thread is doing a sort to satisfy a GROUP BY.

  • Sorting for order

    The thread is doing a sort to satisfy a ORDER BY.

  • Sorting index

    The thread is sorting index pages for more efficient access during a MyISAM table optimization operation.

  • Sorting result

    For a SELECT statement, this is similar to Creating sort index, but for non-temporary tables.

  • statistics

    The server is calculating statistics to develop a query execution plan.

  • System lock

    The thread is going to request or is waiting for an external system lock for the table. If you are not using multiplemysqld servers that are accessing the same tables, you can disable system locks with the --skip-external-lockingoption.

  • Table lock

    The next thread state after System lock. The thread has acquired an external lock and is going to request an internal table lock.

  • Updating

    The thread is searching for rows to update and is updating them.

  • updating main table

    The server is executing the first part of a multiple-table update. It is updating only the first table, and saving fields and offsets to be used for updating the other (reference) tables.

  • updating reference tables

    The server is executing the second part of a multiple-table update and updating the matched rows from the other tables.

  • User lock

    The thread is going to request or is waiting for an advisory lock requested with a GET_LOCK() call.

  • Waiting for tablesWaiting for table

    The thread got a notification that the underlying structure for a table has changed and it needs to reopen the table to get the new structure. However, to reopen the table, it must wait until all other threads have closed the table in question.

    This notification takes place if another thread has used FLUSH TABLES or one of the following statements on the table in question: FLUSH TABLES tbl_nameALTER TABLERENAME TABLEREPAIR TABLEANALYZE TABLE, or OPTIMIZE TABLE.

  • Waiting on cond

    A generic state in which the the thread is waiting for a condition to become true. No specific state information is available.

  • Writing to net

    The server is writing a packet to the network

转载于:https://my.oschina.net/zimingforever/blog/79704

相关文章:

  • GridView里的按钮事件
  • 通用SQL数据库查询语句精华使用简介
  • Cocoa教学:Windows OOP与Cocoa MVC之对比
  • nginx 负载均衡5种配置方式
  • js代码触发事件
  • 编译Chromium
  • WPF基础之路由事件
  • KMP算法初步认知
  • PHP 输入两个整数n 和m,从数列1,2,3.......n 中随意取几个数, 使其和等于m ,要求将其中所有的可能组合列出来...
  • 超凡蜘蛛侠
  • 简单的多进程Open×××前端控制程序
  • asymptote 中使用中文
  • Deprecated: Function ereg() is deprecated in
  • 家庭电力网络摄像机
  • Redis学习系列
  • @angular/forms 源码解析之双向绑定
  • 【140天】尚学堂高淇Java300集视频精华笔记(86-87)
  • 11111111
  • js继承的实现方法
  • k个最大的数及变种小结
  • puppeteer stop redirect 的正确姿势及 net::ERR_FAILED 的解决
  • SpiderData 2019年2月25日 DApp数据排行榜
  • Vue源码解析(二)Vue的双向绑定讲解及实现
  • Webpack 4 学习01(基础配置)
  • WePY 在小程序性能调优上做出的探究
  • 表单中readonly的input等标签,禁止光标进入(focus)的几种方式
  • 理清楚Vue的结构
  • 前端路由实现-history
  • 浅谈JavaScript的面向对象和它的封装、继承、多态
  • 如何编写一个可升级的智能合约
  • 如何在 Tornado 中实现 Middleware
  • 扫描识别控件Dynamic Web TWAIN v12.2发布,改进SSL证书
  • 新版博客前端前瞻
  • 在 Chrome DevTools 中调试 JavaScript 入门
  • 自制字幕遮挡器
  • 【云吞铺子】性能抖动剖析(二)
  • C# - 为值类型重定义相等性
  • python最赚钱的4个方向,你最心动的是哪个?
  • 曾刷新两项世界纪录,腾讯优图人脸检测算法 DSFD 正式开源 ...
  • #在线报价接单​再坚持一下 明天是真的周六.出现货 实单来谈
  • (a /b)*c的值
  • (C)一些题4
  • (Note)C++中的继承方式
  • (Redis使用系列) Springboot 使用redis实现接口幂等性拦截 十一
  • (ZT) 理解系统底层的概念是多么重要(by趋势科技邹飞)
  • (ZT)一个美国文科博士的YardLife
  • (理论篇)httpmoudle和httphandler一览
  • (一)80c52学习之旅-起始篇
  • ***通过什么方式***网吧
  • *p=a是把a的值赋给p,p=a是把a的地址赋给p。
  • .bat文件调用java类的main方法
  • .equals()到底是什么意思?
  • .gitignore文件—git忽略文件
  • .Net CF下精确的计时器
  • .NET Framework 和 .NET Core 在默认情况下垃圾回收(GC)机制的不同(局部变量部分)