title: how to optimize a slow batch INSERT IGNORE in MySQL
body: <p>Just finished rewriting many queries as batch queries - no more DB calls inside of foreach loops!</p>
  
  <p>One of these new batch queries, and insert ignore into a pivot table, is taking 1-4 seconds each time. It is fairly large (~100 rows per call) and the table is also > 2 million rows.</p>
  
  <p>This is the current bottleneck in my program. Should I consider something like locking the table (never done this before, but I have heard it is ... dangerous) or are there other options I should look at first. </p>
  
  <p>As it is a pivot table, there is a unique key comprised of both the rows I am updating. </p>