@Luenissla
I guess I should elaborate here. This can happen with InnoDB tables (which the majority of our tables are). When you restart the database, InnoDB tables reset the auto_increment
to the next available value which can cause the reuse of old, deleted values. Whereas MyISAM tables cache the old auto_increment
value and starts right where it left off. With this being said, this has been changed in MySQL 8.0 so with 8.0+ InnoDB tables will cache the auto_increment
value and pick up where it left off even after restarting.
Cheers.