title: Monetdb - CPU Threads Utilization
body: <p>I have recently installed monetdb "OCT 2014-SP1" release on my Oracle Enterprise 6 Linux server.</p>
  
  <p>Server configuration -</p>
  
  <p>8 CPU Cores
  64 GB RAM</p>
  
  <p>I have loaded a data set with 70 columns having 15 Millions Rows.</p>
  
  <p>I have started mserver5 as below --</p>
  
  <pre><code>mserver5 --debug=10 --set gdk_nr_threads=8 --dbpath=/data/monetdb/testdb  --set mapi_open=true --set mapi_port=54321  --set merovingian_uri=mapi:monetdb://localhost:54321/testdb --set mapi_usock=/data/monetdb/testdb/.mapi.sock --set monet_vault_key=/data/monetdb/testdb/.vaultkey  --set sql_optimizer=default_pipe  --set max_clients=64 
  </code></pre>
  
  <p>Now I have ran a query as below --</p>
  
  <pre><code>select product_type,COUNT(DISTINCT sales_document),sum(ord_qty)  FROM bookings where ord_entry_date between '2014-04-01' and  '2014-10-01'  group by product_type;  
  </code></pre>
  
  <p>This query took around 90 Secs .. 
  So I started tomograph and checked plotted graph ... which shows the parallelism usage as 39.9 % only and its utilizing only 1 thread with maximum time went in the step - group.subgroupdone almost 98%.</p>
  
  <p>My Question is that even I have started the server with gdk_nr_threads=8 , then why it is just using single thread.</p>
  
  <p>More info --</p>
  
  <pre><code>mserver5 --version
  </code></pre>
  
  <p>MonetDB 5 server v11.19.7 "Oct2014-SP1" (64-bit, 64-bit oids)
  Copyright (c) 1993-July 2008 CWI
  Copyright (c) August 2008-2014 MonetDB B.V., all rights reserved
  Visit <a href="http://www.monetdb.org/" rel="nofollow">http://www.monetdb.org/</a> for further information</p>
  
  <p>Found 63.0GiB available memory, 8 available cpu cores</p>
  
  <p>Libraries:</p>
  
  <p>libpcre: 7.8 2008-09-05 (compiled with 7.8)</p>
  
  <p>openssl: OpenSSL 1.0.1e 11 Feb 2013 (compiled with OpenSSL 1.0.1e-fips 11 Feb 2013)</p>
  
  <p>libxml2: 2.7.6 (compiled with 2.7.6)</p>
  
  <p>Compiled by: root@localhost (x86_64-unknown-linux-gnu)</p>
  
  <p>Compilation: gcc -O3 -fomit-frame-pointer -pipe  -D_FORTIFY_SOURCE=2</p>
  
  <p>Linking    : /usr/bin/ld -m elf_x86_64 </p>
  
  <p>Any pointers ??</p>