General Thread States The initial state for a connection thread until the client has been authenticated successfully. The server is enabling or disabling a table index. The thread is trying to open a system table (for example, a time zone or log 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. For system tables, the  Opening system tables  state is used instead. The server is performing initial optimizations for a query. This state occurs during query optimization. The thread is removing unneeded relay log files. This state occurs after processing a query but before the  freeing items  state. The server is reading a packet from the client. 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. The thread is removing an internal temporary table after processing a  SELECT  statement. This state is not used if no temporary table was created. The thread is renaming a table. The thread is processing an  ALTER TABLE  statement, has created the new table, and is renaming it to replace the original table. 1850 •  login •  manage keys •  Opening system tables •  Opening tables •  optimizing •  preparing •  Purging old relay logs •  query end •  Receiving from client •  Removing duplicates •  rename result table •  rename •  removing tmp table