轉-MySQL - Show Processlist 整理

Show processlist

在Show processlist輸出中的Status項: 5.1手冊中沒有的或者翻譯有問題的,都附帶5.5原文說明:mysql

After create

This 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.sql

這個狀態當線程建立一個表(包括內部臨時表)時,在這個建表功能結束時出現。即便某些錯誤致使建表失敗,也會使用這個狀態。緩存

Analyzing

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

當計算MyISAM表索引分佈時。(好比進行ANALYZE TABLE時)網絡

checking permissions

The thread is checking whether the server has the required privileges to execute the statement.多線程

這個線程檢查服務器是否有具備執行該語句的所需權限。app

Checking table

The thread is performing a table check operation.less

線程正在執行表檢查操做。oop

cleaning up

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

線程處理一個命令,並正準備釋放內存和重置某些狀態變量。

closing tables

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

線程正在將變動的表中的數據刷新到磁盤上並正在關閉使用過的表。這應該是一個快速的操做。若是不快,則應該檢查硬盤空間是否已滿或者硬盤IO是否達到瓶頸。

converting HEAP to MyISAM

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

線程將一個內部臨時錶轉換爲磁盤上的MyISAM表。

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.

線程正在處理一個ALTER TABLE語句。這個狀態發生在新的表結構已經建立以後,可是在數據被複制進入以前。

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.

若是一個語句有不一樣的ORDER BY和GROUP BY條件,數據會被複制到一個臨時表中而且按組排序。

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 has become too large (see Section 8.4.3.3, 「How MySQL Uses Internal Temporary Tables」). Consequently, the thread is changing the temporary table from in-memory to diskbased format to save memory.

線程正在將數據寫入磁盤中的臨時表。臨時表的結果集過大(大於tmp_table_size)。因此,線程將臨時表由基於內存模式改成基於磁盤模式,以節省內存。

 

Creating index

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

線程正在對一個MyISAM表執行ALTER TABLE ... ENABLE KEYS語句。

Creating sort index

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

線程正在使用內部臨時表處理一個SELECT 操做。

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 ondisk table, the state during that operation will be Copying to tmp table on disk.

線程正在建立一個臨時表在內存或者磁盤上。若是這個表建立在內存上可是以後被轉換到磁盤上,這個狀態在運行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 columns 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.

線程正在執行ALTER TABLE ... DISCARD TABLESPACE 或 ALTER TABLE ... IMPORT TABLESPACE語句。

end

This occurs at the end but before the cleanup of ALTER TABLE, CREATE VIEW, DELETE, INSERT, SELECT, or UPDATE statements.

這個狀態出如今結束時,可是在對ALTER TABLE, CREATE VIEW, DELETE, INSERT, SELECT, 或者 UPDATE 語句進行清理以前。

executing

The thread has begun executing a statement.

該線程已開始執行一條語句。

Execution of init_command

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

線程正在執行處於init_command系統變量的值中的語句。

freeing items

The thread has executed a command. Some freeing of items done during this state involves the query cache. This state is usually followed by cleaning up.

線程已經執行了命令。在這個狀態中涉及的查詢緩存能夠獲得一些釋放。這個狀態一般後面跟隨cleaning up狀態。

Flushing tables

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

線程正在執行FLUSH TABLES 而且等待全部線程關閉他們的表。

FULLTEXT initialization

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

服務器正在準備進行天然語言全文檢索。

init

This occurs before the initialization of ALTER TABLE, DELETE, INSERT, SELECT, or UPDATE statements. Actions taken by the server in this state include flushing the binary log, the InnoDB log, and some query cache cleanup operations.

For the end state, the following operations could be happening:

• Removing query cache entries after data in a table is changed

• Writing an event to the binary log

• Freeing memory buffers, including for blobs

這個狀態出如今線程初始化ALTER TABLE, DELETE, INSERT, SELECT, 或 UPDATE語句以前。服務器在這種狀態下進行的操做,包括:刷新全日誌、Innodb日誌,和一些查詢緩存清理操做。

對於end狀態,可能會發生下列操做:

在表中的數據變動以後移除查詢緩存。

將事務寫入全日誌。

釋放內存緩衝區,包括大的二進制數據塊。

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.

程序對線程發送了KILL語句,而且它應該放棄下一次對KILL標記的檢查。這個標記在每個MySQL的主要循環中被檢查,但在某些狀況下,它可能須要令線程在很短的時間內死亡。若是這個線程被其餘線程鎖住了,這個KILL操做會在其餘線程釋放鎖的瞬時執行。

Locked

The query is locked by another query.

As of MySQL 5.5.3, this state was removed because it was equivalent to the Table lock state and no longer appears in SHOW PROCESSLIST output.

這個查詢被其餘查詢鎖住了。

在MySQL 5.5.3版本,這個狀態被移除了。由於它至關於表鎖狀態,而且再也不出如今SHOW PROCESSLIST輸出中。

logging slow query

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

這個線程正在將語句寫入慢查詢日誌。

NULL

This state is used for the SHOW PROCESSLIST state.

沒有操做的狀態。

login

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

線程鏈接的初始狀態。直到客戶端已經成功驗證。

manage keys

The server is enabling or disabling a table index.

服務器啓用或禁用表索引。

Opening tables, Opening 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. It is also worth checking that your table_open_cache value is large enough.

線程正試圖打開一張表。這應該是很是快的過程,除非打開受到阻止。一個ALTER TABLE 或LOCK TABLE語句可以阻止打開一張表直到語句運行結束。有必要檢查table_open_cache的值是否足夠大。

optimizing

The server is performing initial optimizations for a query.

服務器執行查詢的初步優化。

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.

這個狀態出如今處理一個查詢以後,可是在freeing items狀態以前。

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.

查詢正在使用SELECT DISTINCT,這種狀況下MySQL不能在早期階段優化掉一些distinct操做。所以,MySQL須要一個額外的階段,在將結果發送到客戶端以前刪除全部重複的行。

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.

線程正在移除一個內置臨時表,在執行一條SELECT語句以後。 若是沒有臨時表產生,那麼這個狀態不被使用。

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.

線程正在處理ALTER 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.

線程完成一個多線程的MyISAM表的修復。

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.

對於MyISAM表的相似repair或analysis操做,線程在.MYI文件的頭部保存一個新表的狀態。狀態信息包括行數、自增數、索引分佈等等。

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.

線程正在進行第一階段,在更新前尋找全部匹配的行。若是update正在更改用於查找相關行的索引,則必須這麼作。

Sending data

The thread is reading and processing rows for a SELECT statement, and sending data to the client. Because operations occurring during this this state tend to perform large amounts of disk access (reads), it is often the longest-running state over the lifetime of a given query.

線程正在讀取和處理一條SELECT語句的行,而且將數據發送至客戶端。因爲在此期間會執行大量的磁盤訪問(讀操做),這個狀態在一個指定查詢的生命週期中常常是耗時最長的。

setup

The thread is beginning an ALTER TABLE operation.

線程正開始進行一個ALTER TABLE操做。

Sorting for group

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

線程正在執行一個由GROUP BY指定的排序。

Sorting for order

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

線程正在執行一個由ORDER BY指定的排序。

 

Sorting index

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

線程正在對索引頁進行排序,爲了對MyISAM表進行操做時得到更優的性能。

Sorting result

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

對於一個SELECT語句,這與建立排序索引類似,可是是對非臨時表。

statistics

The server is calculating statistics to develop a query execution plan. If a thread is in this state for a long time, the server is probably disk-bound performing other work.

服務器計算統計去規劃一個查詢。若是一個線程長時間處於這個狀態,這個服務器的磁盤可能在執行其餘工做。

System lock

The thread is going to request or is waiting for an internal or external system lock for the table. If this state is being caused by requests for external locks and you are not using multiple mysqld servers that are accessing the same MyISAM tables, you can disable external system locks with the --skip-external-locking option. However, external locking is disabled by default, so it is likely that this option will have no effect. For SHOW PROFILE, this state means the thread is requesting the lock

(not waiting for it).

這個線程正在請求或者等待一個內部的或外部的系統表鎖。若是這個狀態是因爲外部鎖的請求產生的,而且你沒有使用多個正在訪問相同的表的mysqld服務器,那麼你可使用--skip-external-locking選項禁用外部系統鎖。然而,外部系統鎖默認狀況下禁用,所以這個選項可能不會產生效果。對於SHOW PROFILE,這個狀態意味着線程正在請求鎖。(而非等待)

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.

This state was replaced in MySQL 5.5.6 with Waiting for table level lock.

系統鎖定後的下一個線程狀態。線程已得到外部鎖而且將請求內部表鎖。

這個狀態在MySQL 5.5.6版本中被Waiting for table level 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 columns 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. For SHOW PROFILE, this state means the thread is requesting the lock (not waiting for it).

線程正在請求或等待一個GET_LOCK()調用所要求的諮詢鎖。對於SHOW PROFILE,這個狀態意味這線程正在請求鎖。(而非等待)

 

User sleep

The thread has invoked a SLEEP() call.

線程調用了一個SLEEP()。

Waiting for all running commits to finish

A statement that causes an explicit or implicit commit is waiting for release of a read lock. This state was removed in MySQL 5.5.8; Waiting for commit lock is used instead.

一個顯式或隱式語句在提交時等待釋放讀鎖。這個狀態在MySQL 5.5.8版本中被移除,以Waiting for commit lock代替。

Waiting for commit lock

A statement that causes an explicit or implicit commit is waiting for release of a read lock or FLUSH TABLES WITH READ LOCK) is waiting for a commit lock. This state was added in MySQL 5.5.8.

同上,這個狀態於MySQL 5.5.8版本加入。

Waiting for global read lock

FLUSH TABLES WITH READ LOCK) is waiting for a global read lock.

等待全局讀鎖。

Waiting for release of readlock

The thread is waiting for a global read lock obtained by another thread (with FLUSH TABLES WITH READ LOCK) to be released.This state was removed in MySQL 5.5.8; Waiting for global read lock or Waiting for commit lock are used instead.

等待釋放讀鎖。

Waiting for tables, Waiting for table, Waiting for table flush

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_name, ALTER TABLE, RENAME TABLE, REPAIR TABLE, ANALYZE TABLE, or OPTIMIZE TABLE.

In MySQL 5.5.6, Waiting for table was replaced with Waiting for table flush.

線程得到一個通知,底層表結構已經發生變化,它須要從新打開表來獲取新的結構。然而,從新打開表,它必須等到全部其餘線程關閉這個有問題的表。

這個通知產生一般由於另外一個線程對問題表執行了FLUSH TABLES或者如下語句之一:FLUSH TABLES tbl_name, ALTER TABLE, RENAME TABLE, REPAIR TABLE, ANALYZE TABLE, or OPTIMIZE TABLE.

Waiting for lock_type lock

The server is waiting to acquire a lock, where lock_type indicates the type of lock:

• Waiting for event metadata lock (added in MySQL 5.5.8)

• Waiting for global metadata lock (replaced by Waiting for global read lock in MySQL 5.5.8)

• Waiting for global read lock (added in MySQL 5.5.8)

• Waiting for schema metadata lock

• Waiting for stored function metadata lock

• Waiting for stored procedure metadata lock

• Waiting for table level lock

• Waiting for table metadata lock

• Waiting for trigger metadata lock (added in MySQL 5.5.8)

等待各個種類的表鎖。

Waiting on cond

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

一個普通的狀態,線程正在等待一個條件爲真。沒有特定的狀態信息可用。

Waiting to get readlock

The thread has issued a FLUSH TABLES WITH READ LOCK statement to obtain a global read lock and is waiting to obtain the lock. This state was removed in MySQL 5.5.8; Waiting for global read lock is used instead.

線程發出了一個FLUSH TABLES WITH READ LOCK語句來獲取一個全局讀鎖,而且等待得到這個鎖。這個狀態在MySQL 5.5.8被移除,使用Waiting for global read lock 來代替。

Writing to net

The server is writing a packet to the network.

服務器正在寫一個網絡數據包

相關文章
相關標籤/搜索