Recently i saw in my database (InnoDB), that my "ID" column which is set to autoincrement, does count a bit weird. When i update a record with
INSERT INTO users (user, group) VALUES ('username', 'group') ON DUPLICATE KEY UPDATE username = 'username', group = 'group'
autoincrement counts the ID, so now my table is looking as follows:
----------------
|id|user |group|
----------------
|1 |test |3 |
|2 |test2|5 |
|5 |foo |2 |
|6 |bar |4 |
|10|user |2 |
----------------
I read about this "issue" but didn't really found and answer on how to make the autoincrement field not count, if the record gets updated only.