mysql show processlist整理

Show processlist

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

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.

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

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.

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

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

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.

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章