title: Should I put an index on a MySQL table that is frequently getting new rows
body: <p>I'm creating a table that will track certain keywords used when accessing a website. The table, for now, will be very simple:</p>
  
  <pre><code>id (INT, 11, unsigned, primary key, auto_inc)
  keyword (VARCHAR, 32)
  hits (INT, 10, unsigned)
  </code></pre>
  
  <p>Every time a user hits the site we will extract a series of keyword from their HTTP_REFERER and then count these in the table. If the keyword already exists in the table then we <code>hits++</code>, if not then we insert a new row with <code>hits=1</code>. </p>
  
  <p>All very simple, the question is, should I make <code>keyword</code> an index on the table? From what I've read making a column an index that is constantly getting new rows added isn't going to help performance as the <code>INSERTS</code> become much slower. There will inevitably be a lot of <code>INSERTS</code>, so will the performance gain found by the quicker updates be outweighed by slowing down the inserts? If this table ends up being maybe ~100k rows, would an index even be beneficial? We'd be averaging about 4 queries per minute, so the load won't be high at all.</p>
  
  <p>This question is very hypothetical but it's not easy to load test this without putting it under live load, which I don't want to do blind.</p>