title: MySQL/MariaDB run single query on multiple cores
body: <p>I have a decently strong database server with around 24 cores and 48 GB of RAM. We are running MariaDB 10.0 as our database engine. All my tables are running on InnoDB engine.I have a few queries that employ rather extensive joins over large tables and hence are naturally slow. One thing I am struggling to do is to try and leverage the power of multiple cores. Here are my observation:</p>
  
  <ol>
  <li>If I run 2 queries in parallel, then I can see 2 cores being utilized</li>
  <li>If I run 1 query, I see only 1 core being utilized at 100%</li>
  </ol>
  
  <p>Now, is this the normal behavior? What I mean is that is there no way in MariaDB/MySQL to utilize more than one core for a single query? It will be great if a single heavy query can run faster by utilizing multiple CPU cores.</p>
  
  <p>I did try and search multiple forums and have played with different parameters like Innodb_thread_cocurrency, but so far haven't been able to run a single query on multiple cores.</p>
  
  <p>Is there any other engine which can help me do that (I am currently reading about XtraDB)?</p>
  
  <p>UPDATE: </p>
  
  <p>Well, actually I am trying to analyze social media data. So imagine a database with 2-3 million tweets. Naturally we are talking associated tables with USer data, hashtags, images, links etc. So all in all a decently large database. In certain cases there are queries which require some joins on multiple tables and are naturally slow. So, imagine , for instance a dashboard query with 5-6 different queries. When a single user logins, this puts load on a single core and the entire core is utilized for n seconds. If I have 12 cores with me, and suppose 12 users simultaneously try to access the system, then I have a serious bottleneck. I understand completely, that options like sharding, clustering, distributed DB, partitioning could help me. But right now I am trying to understand how best to Scale a system vertically before I look at horizontal scaling (wherein I introduce more servers). Utilization of multiple cores would have been a great option, but I guess now I understand that, MySQL isn't inherently designed as such. I think I will start looking at various [possible architectures to scale the DB over multiple instances.</p>