New answers tagged auto-increment
Last Sentence of MySQL Documentation on Traditional InnoDB Auto-Increment Locking says You may see gaps in the sequence of values assigned to the AUTO_INCREMENT column if you roll back transactions that have generated numbers using the counter. Therefore, if the second INSERT had failed and rolled back, it makes the gap. You may have to set ...
Here is an overview of methods to generate random unique ids in mysql, by Rick James: http://forums.mysql.com/read.php?24,425424,425491 The overview is quite comprehensive, gives 5 different strategies, lists pros and cons for every one.
Top 50 recent answers are included