Multithreading in MySQL?

2019-05-01 11:42发布

问题:

Are MySQL operations multithreaded?

Specifically, on running a select, does the select (or join) algorithm spawn multiple threads to run together? Would being multi-threaded prevent being able to support a lot of concurrent users?

回答1:

Several background threads run in a MySQL server. Also, each database connection is served by a single thread. Parallel queries (selects using multiple threads) are not implemented in MySQL.

MySQL as is can support "a lot of concurrent useres". For example Facebook started successfully with MySQL.



回答2:

Besides each connection has a thread, there are several management processes which has it's own thread. It's an arrangement commonly seen in DBMS. E.g. Oracle RDMS has System Monitor, DB Writer and so on.
The sport is cached-reading and lazy-writing.