I am running a query on a table that has over 5 million rows and this query takes about 30 minutes to run. For obvious reasons this is unacceptable, and I have rewritten the query to perform in under 10 seconds. But my underlying problem is that the query is only using around 12.5% cpu and appears to not be using the full resources of the server. The server has 8 cores and only appears to be using 1 when running the query 100%/8 cores = 12.5% CPU per core. The database uses the MyISAM engine if that matters.
I understand that in most circumstances you don’t want your server bogged down by 1 query, but in this case it is acceptable (the query is running on a testing server that is not accessible to the real world so traffic and other running services are not a problem).
Long story short, Is it possible to give a single query access to more than 1 CPU or because of MySQL architecture is it impossible to thread(at the CPU level) a single query? I guess there is also a third option that it is just a coincidence that the query is only using 12.5 cpu and MySQL can use multiple cores per query.
“Currently one SQL statement runs from start to end in the same
physical thread.”
http://lists.mysql.com/internals/37329