title: Does InnoDB lock the whole table for a delete which uses part of a composed key?
body: <p>I have a MySQL table (call it 'my_table') with a composed primary key with 4 columns (call them 'a', 'b', 'c' and 'd').</p>
  
  <p>At least one time I encountered a deadlock on parallel asynchronous EJB calls calling '<strong>DELETE FROM my_table where a=? and b=?</strong>' with different values, so I started to look into how InnoDB table locking works.  </p>
  
  <p>I've found no clear documentation on how table locking works with composed keys. Is the whole table locked by the delete, despite the fact that there's no overlap among the actual rows being deleted?</p>
  
  <p>Do I need to do a select to recover the values for c and d and delete batches using the whole primary key?  </p>
  
  <p>This is in the context of a complex application which works with 4 different databases. Only MySQL seems to have this issue.</p>