title: Auto_increment values in InnoDB?
body: <p>I've been using InnoDB for a project, and relying on auto_increment.  This is not a problem for most of the tables, but for tables with deletion, this might be an issue:</p>
  
  <p><a href="http://dev.mysql.com/doc/refman/5.0/en/innodb-auto-increment-handling.html" rel="noreferrer"> AUTO_INCREMENT Handling in InnoDB</a></p>
  
  <p>particularly this part:</p>
  
  <blockquote>AUTO_INCREMENT column named ai_col: After a server startup, for the first insert into a table t, InnoDB executes the equivalent of this statement:
  
  SELECT MAX(ai_col) FROM t FOR UPDATE;
  InnoDB increments by one the value retrieved by the statement and assigns it to the column and to the auto-increment counter for the table.</blockquote>
  
  <p>This is a problem because while it ensures that within the table, the key is unique, there are foreign keys to this table where those keys are no longer unique.</p>
  
  <p>The mysql server does/should not restart often, but this is breaking.  Are there any easy ways around this?</p>