# General Thread States

This article documents the major general thread states. More specific lists related to [delayed inserts](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/insert-delayed), replication, the [query cache](https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/buffers-caches-and-threads/query-cache) and the [event scheduler](https://mariadb.com/docs/server/server-usage/triggers-events/event-scheduler/events) are listed in:

* [Event Scheduler Thread States](https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/buffers-caches-and-threads/thread-states/event-scheduler-thread-states)
* [Query Cache Thread States](https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/buffers-caches-and-threads/thread-states/query-cache-thread-states)
* [Master Thread States](https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/buffers-caches-and-threads/thread-states/master-thread-states)
* [Slave Connection Thread States](https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/buffers-caches-and-threads/thread-states/slave-connection-thread-states)
* [Slave I/O Thread States](https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/buffers-caches-and-threads/thread-states/replica-io-thread-states)
* [Slave SQL Thread States](https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/buffers-caches-and-threads/thread-states/slave-sql-thread-states)

These correspond to the `STATE` values listed by the [SHOW PROCESSLIST](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-processlist) statement or in the [Information Schema PROCESSLIST Table](https://mariadb.com/docs/server/reference/system-tables/information-schema/information-schema-tables/information-schema-processlist-table) as well as the `PROCESSLIST_STATE` value listed in the [Performance Schema threads Table](https://mariadb.com/docs/server/reference/system-tables/performance-schema/performance-schema-tables/performance-schema-threads-table)

| Value                           | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| After create                    | The function that created (or tried to create) a table (temporary or non-temporary) has just ended.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Analyzing                       | Calculating table key distributions, such as when running an [ANALYZE TABLE](https://mariadb.com/docs/server/reference/sql-statements/table-statements/analyze-table) statement.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| checking permissions            | Checking to see whether the permissions are adequate to perform the statement.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Checking table                  | [Checking](https://mariadb.com/docs/server/reference/sql-statements/table-statements/check-table) the table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| cleaning up                     | Preparing to reset state variables and free memory after executing a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| closing tables                  | Flushing the changes to disk and closing the table. This state will only persist if the disk is full or under extremely high load.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| converting HEAP to Aria         | Converting an internal [MEMORY](https://mariadb.com/docs/server/server-usage/storage-engines/memory-storage-engine) temporary table into an on-disk [Aria](https://mariadb.com/docs/server/server-usage/storage-engines/aria) temporary table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| converting HEAP to MyISAM       | Converting an internal [MEMORY](https://mariadb.com/docs/server/server-usage/storage-engines/memory-storage-engine) temporary table into an on-disk [MyISAM](https://mariadb.com/docs/server/server-usage/storage-engines/myisam-storage-engine) temporary table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| copy to tmp table               | A new table has been created as part of an [ALTER TABLE](https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-table) statement, and rows are about to be copied into it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Copying to group table          | Sorting the rows by group and copying to a temporary table, which occurs when a statement has different [GROUP BY](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select#group-by) and [ORDER BY](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select#order-by) criteria.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Copying to tmp table            | Copying to a temporary table in memory.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Copying to tmp table on disk    | Copying to a temporary table on disk, as the resultset is too large to fit into memory.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Creating index                  | Processing an [ALTER TABLE ... ENABLE KEYS](https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-table) for an [Aria](https://mariadb.com/docs/server/server-usage/storage-engines/aria) or [MyISAM](https://mariadb.com/docs/server/server-usage/storage-engines/myisam-storage-engine) table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Creating sort index             | Processing a [SELECT](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select) statement resolved using an internal temporary table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| creating table                  | Creating a table (temporary or non-temporary).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Creating tmp table              | Creating a temporary table (in memory or on-disk).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| deleting from main table        | Deleting from the first table in a multi-table [delete](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/delete), saving columns and offsets for use in deleting from the other tables.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| deleting from reference tables  | Deleting matched rows from secondary reference tables as part of a multi-table [delete](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/delete).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| discard\_or\_import\_tablespace | Processing an [ALTER TABLE ... IMPORT TABLESPACE](https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-table) or [ALTER TABLE ... DISCARD TABLESPACE](https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-table) statement.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| end                             | State before the final cleanup of an [ALTER TABLE](https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-table), [CREATE VIEW](https://mariadb.com/docs/server/server-usage/views/create-view), [DELETE](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/delete), [INSERT](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/insert), [SELECT](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select), or [UPDATE](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/update) statement.                                                                                                                                                                                                                                                                                                                                     |
| executing                       | Executing a statement.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Execution of init\_command      | Executing statements specified by the --init\_command [mariadb client](https://mariadb.com/docs/server/clients-and-utilities/mariadb-client/mariadb-command-line-client) option.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| filling schema table            | A table in the [information\_schema](https://mariadb.com/docs/server/reference/system-tables/information-schema) database is being built.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| freeing items                   | Freeing items from the [query cache](https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/buffers-caches-and-threads/query-cache) after executing a command. Usually followed by the cleaning up state.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Flushing tables                 | Executing a [FLUSH TABLES](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/flush-commands/flush) statement and waiting for other threads to close their tables.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| FULLTEXT initialization         | Preparing to run a [full-text](https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/optimization-and-indexes/full-text-indexes) search. This includes running the fulltext search (MATCH ... AGAINST) and creating a list of the result in memory                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| init                            | About to initialize an [ALTER TABLE](https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-table), [DELETE](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/delete), [INSERT](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/insert), [SELECT](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select), or [UPDATE](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/update) statement. Could be performaing [query cache](https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/buffers-caches-and-threads/query-cache) cleanup, or flushing the [binary log](https://mariadb.com/docs/server/server-management/server-monitoring-logs/binary-log) or InnoDB log.                                                                                                                                  |
| Killed                          | Thread will abort next time it checks the kill flag. Requires waiting for any locks to be released.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Locked                          | Query has been locked by another query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| logging slow query              | Writing statement to the [slow query log](https://mariadb.com/docs/server/server-management/server-monitoring-logs/slow-query-log).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| NULL                            | State used for [SHOW PROCESSLIST](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-processlist).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| login                           | Connection thread has not yet been authenticated.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| manage keys                     | Enabling or disabling a table index.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Opening table\[s]               | Trying to open a table. Usually very quick unless the limit set by [table\_open\_cache](https://mariadb.com/docs/server/server-management/variables-and-modes/server-system-variables#table_open_cache) has been reached, or an [ALTER TABLE](https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-table) or [LOCK TABLE](https://mariadb.com/docs/server/reference/sql-statements/transactions/lock-tables) is in progress.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| optimizing                      | Server is performing initial optimizations in for a query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| preparing                       | State occurring during query optimization.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Purging old relay logs          | Relay logs that are no longer needed are being removed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| query end                       | Query has finished being processed, but items have not yet been freed (the freeing items state.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Reading file                    | Server is reading the file (for example during [LOAD DATA INFILE](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/load-data-into-tables-or-index/load-data-infile)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Reading from net                | Server is reading a network packet.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Removing duplicates             | Duplicated rows being removed before sending to the client. This happens when SELECT DISTINCT is used in a way that the distinct operation could not be optimized at an earlier point.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| removing tmp table              | Removing an internal temporary table after processing a [SELECT](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select) statement.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| rename                          | Renaming a table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| rename result table             | Renaming a table that results from an [ALTER TABLE](https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-table) statement having created a new table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Reopen tables                   | Table is being re-opened after thread obtained a lock but the underlying table structure had changed, so the lock was released.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Repair by sorting               | Indexes are being created with the use of a sort. Much faster than the related Repair with keycache.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Repair done                     | Multi-threaded repair has been completed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Repair with keycache            | Indexes are being created through the key cache, one-by-one. Much slower than the related Repair by sorting.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Rolling back                    | A transaction is being rolled back.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Saving state                    | New table state is being saved. For example, after, analyzing a [MyISAM](https://mariadb.com/docs/server/server-usage/storage-engines/myisam-storage-engine) table, the key distributions, rowcount etc. are saved to the .MYI file.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Searching rows for update       | Finding matching rows before performing an [UPDATE](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/update), which is needed when the UPDATE would change the index used for the UPDATE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Sending data                    | Sending data to the client as part of processing a [SELECT](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select) statement or other statements that returns data like [INSERT ... RETURNING](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/insertreturning) . Often the longest-occurring state as it also include all reading from tables and disk read activities. Where an aggregation or un-indexed filtering occurs there is significantly more rows read than what is sent to the client.                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| setup                           | Setting up an [ALTER TABLE](https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-table) operation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Sorting for group               | Sorting as part of a [GROUP BY](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select#group-by)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Sorting for order               | Sorting as part of an [ORDER BY](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select#order-by)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Sorting index                   | Sorting index pages as part of a table optimization operation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Sorting result                  | Processing a [SELECT](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select) statement using a non-temporary table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| statistics                      | Calculating statistics as part of deciding on a query execution plan. Usually a brief state unless the server is disk-bound.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| System lock                     | Requesting or waiting for an external lock for a specific table. The [storage engine](https://mariadb.com/docs/server/server-usage/storage-engines) determines what kind of external lock to use. For example, the [MyISAM](https://mariadb.com/docs/server/server-usage/storage-engines/myisam-storage-engine) storage engine uses file-based locks. However, MyISAM's external locks are disabled by default, due to the default value of the [skip\_external\_locking](https://mariadb.com/docs/server/server-management/variables-and-modes/server-system-variables#skip_external_locking) system variable. Transactional storage engines such as [InnoDB](https://mariadb.com/docs/server/server-usage/storage-engines/innodb) also register the transaction or statement with MariaDB's [transaction coordinator](https://mariadb.com/docs/server/server-management/server-monitoring-logs/transaction-coordinator-log) while in this thread state. See [MDEV-19391](https://jira.mariadb.org/browse/MDEV-19391) for more information about that. |
| Table lock                      | About to request a table's internal lock after acquiring the table's external lock. This thread state occurs after the System lock thread state.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| update                          | About to start updating table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Updating                        | Searching for and updating rows in a table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| updating main table             | Updating the first table in a multi-table update, and saving columns and offsets for use in the other tables.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| updating reference tables       | Updating the secondary (reference) tables in a multi-table update                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| updating status                 | This state occurs after a query's execution is complete. If the query's execution time exceeds [long\_query\_time](https://mariadb.com/docs/server/server-management/variables-and-modes/server-system-variables#long_query_time), then [Slow\_queries](https://mariadb.com/docs/server/server-management/variables-and-modes/server-status-variables#slow_queries) is incremented, and if the [slow query log](https://mariadb.com/docs/server/server-management/server-monitoring-logs/slow-query-log) is enabled, then the query is logged. If the [SERVER\_AUDIT](https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin) plugin is enabled, then the query is also logged into the audit log at this stage. If the [userstats](https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/query-optimizations/statistics-for-optimizing-queries/user-statistics) plugin is enabled, then CPU statistics are also updated at this stage.                                                                            |
| User lock                       | About to request or waiting for an advisory lock from a [GET LOCK()](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/miscellaneous-functions/get_lock) call. For [SHOW PROFILE](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-profile), means requesting a lock only.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| User sleep                      | A [SLEEP()](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/miscellaneous-functions/sleep) call has been invoked.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Waiting for commit lock         | [FLUSH TABLES WITH READ LOCK](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/flush-commands/flush) is waiting for a commit lock, or a statement resulting in an explicit or implicit commit is waiting for a read lock to be released. This state was called Waiting for all running commits to finish in earlier versions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Waiting for global read lock    | Waiting for a global read lock.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Waiting for table level lock    | External lock acquired,and internal lock about to be requested. Occurs after the System lock state. In earlier versions, this was called Table lock.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Waiting for xx lock             | Waiting to obtain a lock of type xx.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Waiting on cond                 | Waiting for an unspecified condition to occur.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Writing to net                  | Writing a packet to the network.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/buffers-caches-and-threads/thread-states/general-thread-states.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
