If you utilize REPLACE INTO and you have an AUTO_INCREMENT field (i.e. index/id column), that auto increment column will be incremented. However, if you use INSERT .. ON DUPLICATE KEY UPDATE the index value will remain the same (because an update is being performed) in the case there is a duplicate key.