// mysql · parallelism & workers

innodb_parallel_read_threads

Threads for parallel clustered index reads.

Predeterminado
Logical CPUs / 8, minimum 4
Range
1 to 256
Restart needed
No
Default checked on
MySQL 8.4 LTS

Lo que hace

Used by CHECK TABLE and SELECT COUNT(*) without a WHERE clause. MySQL has no general parallel query.

Valor predeterminado

Logical CPUs / 8, minimum 4. One eighth of the logical processors, at least 4, since MySQL 8.4 (a fixed 4 before).

Check the current value

SHOW GLOBAL VARIABLES LIKE 'innodb_parallel_read_threads';

SELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME
FROM performance_schema.variables_info
WHERE VARIABLE_NAME = 'innodb_parallel_read_threads';

Change it

SET SESSION innodb_parallel_read_threads = 8;   -- this connection
SET GLOBAL innodb_parallel_read_threads = 8;    -- new connections, until restart
SET PERSIST innodb_parallel_read_threads = 8;   -- new connections, and after restarts

No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.

When to change it

Raise per session before counting or checking very large tables.

What can go wrong

Low.

Questions about innodb_parallel_read_threads

What is the default value of innodb_parallel_read_threads in MySQL?

Logical CPUs / 8, minimum 4. One eighth of the logical processors, at least 4, since MySQL 8.4 (a fixed 4 before).

Does changing innodb_parallel_read_threads require a restart?

No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.

When should I change innodb_parallel_read_threads?

Raise per session before counting or checking very large tables.

Back to all MySQL settings, or check the MySQL manual for every option.

// one client for every engine

Check innodb_parallel_read_threads on your own server

SQLly runs the query above against MySQL and the other engines in this reference, from one desktop app on macOS, Windows and Linux.