• 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 nontemporary tables. 

• starting 

The first stage at the beginning of statement execution. 

• 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 has called mysql_lock_tables()  and the thread state has not been updated since. This is a very general state that can occur for many reasons. 

For example, the thread is going to request or is waiting for an internal or external system lock for the table. This can occur when InnoDB  waits for a table-level lock during execution of LOCK TABLES . 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 has no effect. For SHOW PROFILE , this state means the thread is requesting the lock (not waiting for it). 

For system tables, the Locking system tables  state is used instead. 

• update 

The thread is getting ready to start updating the table. 

• 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). 

• User sleep 

The thread has invoked a SLEEP()  call. 

