title: MySQL state "closing tables" taking double the time of process
body: <p>I have a delete query that is taking a long time. When I check in <code>processlist</code> that status is showing as "<em>closing tables</em>". It is taking a long time to close tables.</p>
  
  <p><em>Example:</em><br>
  I run a query and the total time is <em>1:42</em> seconds and in that <em>80-90</em> seconds are for closing table.</p>
  
  <p>This is happening for all queries like <code>load data</code> , <code>select</code> and <code>insert</code>.</p>
  
  <p>Below is <em>my.cnf</em> settings:</p>
  
  <pre><code>key_buffer_size = 2G
  sort_buffer_size = 8M
  read_buffer_size = 10M
  read_rnd_buffer_size = 10M
  join_buffer_size = 2M
  bulk_insert_buffer_size = 100M
  myisam_sort_buffer_size = 64M
  
  #tmp_table_size = 100M
  #max_heap_table_size = 64M
  #max_allowed_packet = 64M
  
  table_cache=1024
  </code></pre>
  
  <p><br>
  My meminfo</p>
  
  <pre><code>[root@localhost ~]# free -m
               total       used       free     shared    buffers     cached
  Mem:          7862       6686       1175          0         11       4091
  -/+ buffers/cache:       2583       5278
  Swap:        15998         18      15980
  </code></pre>
  
  <p><br>
  Please tell me what kind of changes I need to do in <em>my.cnf</em> file?</p>