- 论坛徽章:
- 0
|
RE: is MySQL query execution single threaded?
Assuming you are asking if a SELECT is split up so that multiple CPUs
can participate in the operation, I don't believe any of these do such.
MyISAM, InnoDB, InfoBright, Partition, Federated (client), and Merge (at
least) fail to do such as of 5.1.
InnoDB uses I/O threads that are separate from the single SQL thread.
These are shared resources.
Separate SELECTs do use separate threads, but they stumble over each
other due to inefficiencies in
* Malloc in InnoDB
* premature locking of the Query Cache (unless it is fully OFF)
* key_buffer locking
Various 5.1 benchmarks show that these problems cause a decline in
system throughput after about 4-8 cores. The problems are addressed to
various degrees in the "Google patch", the "Percona patch" (derived from
Google), and 5.4.
[Please correct any misrepresentations I have made.]
Rick James
MySQL Geeks - Consulting & Review
-----------------------------------------------------------------------------------------
学习了,多谢各位.
刚好在10月的邮件列表里看到这么封邮件,也是讨论单个查询是怎么执行的..
以上的邮件地址如下:
http://lists.mysql.com/internals/37347
有几点疑问,他所说的把一个select分割到多个核上执行的三点问题具体是怎么回事呢:
1.InnoDB 使用的malloc的问题? -- malloc对分割操作具体有什么影响呢? 查了下好像google的patch中是用了tcmalloc
2.过早的锁定查询缓存? -- 难道不是先在查询缓存中查询完此select指令还未执行过,然后才开始把select分割的吗?
3.索引缓存的锁定? -- 也就是分割到多个核上执行的select不能同时访问索引缓存?
然后他说这些问题,已经被解决了..google的patch,和mysql 5.4.
想知道,他们是怎么做的呢, mysql5.4中具体是怎么支持多核的呢? |
|