I'm again returning to InnoDB scalability and related bug
#15815 as it hurts many users and customers using multi-cpu
servers.
Short intro into problem:
On 4-CPU box 1 thread executes full-table scan select query for 8
sec,
but with 4 threads - each thread executes query for 240
sec.
It is very strange as threads use only SELECT queries and ideally
there should be no
any problem in concurrent enviroment, especially for CPU-bound
workload.
I did the profiling which show the problem is with "buffer pool"
mutex, which protects innodb_buffer_pool.
In details, for each scanned row InnoDB calls block_get /
block_release functions
which aquire/release the block related to the current row. And
the problem functions
block_get / block_release use
mutex_lock(buffer_pool_mutex) / …