This is an automated archive.

The original was posted on /r/mysql by /u/LordMarcel on 2023-08-19 19:35:01+00:00.


I am building a database of speedskating results and for some reason I can’t figure out my auto-increment keeps skipping numbers in between almost every time I add data.

For example, here it skips ahead 4 numbers between the men’s 1000m and the women’s 1000m:

I googled this and the only thing I can find is that it happens due to failed inserts or deletions, and while that does happen sometimes, these two distances were added without any fails or deletions:

My query for the input looks like this:

I also read that this can happen if you add data right after a restart of your server, but that also didn’t happen. I added every distance on 2005-11-26 without any restarts, bugs, glitches, deletions, or failed inserts. It only took me about 5 minutes total to add them all.

In total I added 8 different distances that were held on 2005-11-26, so there are 7 gaps in beween adding them as I add one distance at a time. All but one of those gaps have skipped numbers, usually around 13 but sometimes only about 4.

I know it’s not a big deal and it doesn’t really matter but I’m still curious why this could happen.