title: ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id) without increasing autoindex
body: <p>I'm running a SQL query, looks a bit like this</p>
  
  <pre><code>INSERT INTO people (Name, Role)
  VALUES('{$Name}', '{$Occupation')
  ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id)
  </code></pre>
  
  <p>The 'people' table has a surrogate ID key as primary, that is set by MySQLs Autoindex.</p>
  
  <p>'Name' and 'Role' is put together as a composite unique key.</p>
  
  <p>Problem is, when I run this query and hit someone with the same name and role, and get their respective ID, the autoindex still increases. </p>
  
  <p>Is it possible to prevent this easily, or do i need to run 2 separate queries to check if already exists and then insert?</p>