#### 27.12.16.3 The tp\_thread\_state Table

[]()[]()

Note

 The Performance Schema table described here is available as of MySQL 8.0.14. Prior to MySQL 8.0.14, use the corresponding `INFORMATION_SCHEMA` table instead; see [Section 26.5.4, “The INFORMATION\_SCHEMA TP\_THREAD\_STATE Table”](information-schema-tp-thread-state-table.html).

 The [`tp_thread_state`](performance-schema-tp-thread-state-table.html) table has one row per thread created by the thread pool to handle connections.

 The [`tp_thread_state`](performance-schema-tp-thread-state-table.html) table has these columns:

* `TP_GROUP_ID`

   The thread group ID.

* `TP_THREAD_NUMBER`

   The ID of the thread within its thread group. `TP_GROUP_ID` and `TP_THREAD_NUMBER` together provide a unique key within the table.

* `PROCESS_COUNT`

   The 10ms interval in which the statement that uses this thread is currently executing. 0 means no statement is executing, 1 means it is in the first 10ms, and so forth.

* `WAIT_TYPE`

   The type of wait for the thread. `NULL` means the thread is not blocked. Otherwise, the thread is blocked by a call to `thd_wait_begin()` and the value specifies the type of wait. The `*`xxx`*_WAIT` columns of the [`tp_thread_group_stats`](performance-schema-tp-thread-group-stats-table.html) table accumulate counts for each wait type.

   The `WAIT_TYPE` value is a string that describes the type of wait, as shown in the following table.

  []()

  **Table 27.6 tp\_thread\_state Table WAIT\_TYPE Values**

  |        Wait Type        |         Meaning         |
  |-------------------------|-------------------------|
  |    `THD_WAIT_SLEEP`     |    Waiting for sleep    |
  |    `THD_WAIT_DISKIO`    |   Waiting for Disk IO   |
  |   `THD_WAIT_ROW_LOCK`   |  Waiting for row lock   |
  | `THD_WAIT_GLOBAL_LOCK`  | Waiting for global lock |
  |`THD_WAIT_META_DATA_LOCK`|Waiting for metadata lock|
  |  `THD_WAIT_TABLE_LOCK`  | Waiting for table lock  |
  |  `THD_WAIT_USER_LOCK`   |  Waiting for user lock  |
  |    `THD_WAIT_BINLOG`    |   Waiting for binlog    |
  | `THD_WAIT_GROUP_COMMIT` |Waiting for group commit |
  |     `THD_WAIT_SYNC`     |    Waiting for fsync    |

 The [`tp_thread_state`](performance-schema-tp-thread-state-table.html) table has these indexes:

* Unique index on (`TP_GROUP_ID`, `TP_THREAD_NUMBER`)

[`TRUNCATE TABLE`](truncate-table.html) is not permitted for the [`tp_thread_state`](performance-schema-tp-thread-state-table.html) table.

