I have a database with tables using InnoDB and an auto increment field as primary key. I'm wondering if I can rely on the fact that the highest value of a field using auto_increment
is always the most recent.
I didn't find anything clear enaugh on this point.
I stumbled upon this question, while looking for answer for similar question and I believe there is some confusion about this question - so to answer: can I rely on the fact that the highest value of a field using auto_increment is always the most recent
according to https://dba.stackexchange.com/questions/60295/why-does-auto-increment-jumps-by-more-than-the-number-of-rows-inserted (The only guarantees from an auto_increment column (or IDENTITY in MSSQL, and the other names the concept goes by) is that each value will be unique and never smaller than a previous one: so you can rely on the values for ordering but you can not rely on them not to have gaps.)
Yes, unless you update auto-generated value manually.